class Interview::Button

Attributes

caption[RW]
name[RW]
style[RW]
submit[RW]

Public Instance Methods

build(b) click to toggle source
# File lib/interview/controls/button.rb, line 8
def build(b)
  html_class = @html_class.dup
  if @style.to_s == 'primary'
    html_class += %w(btn btn-primary)
  else
    html_class += %w(btn btn-default)
  end
  @html_options[:name] = @name
  
  if @submit
    b << h.submit_tag(@caption, options_to_html(@html_options, html_class))
  else
    b << h.button_tag(@caption, options_to_html(@html_options, html_class))
  end
end