Module: Bootstrap::ViewHelpers::ButtonHelper

Defined in:
app/helpers/bootstrap/view_helpers/button_helper.rb

Instance Method Summary collapse

Instance Method Details

#bs_button(label, options = {}, &block) ⇒ Object



4
5
6
7
8
# File 'app/helpers/bootstrap/view_helpers/button_helper.rb', line 4

def bs_button(label, options = {}, &block)
  options[:label] = label
  Components::Button.build(self, options, &block).to_html
  button_tag
end

#bs_checkbox_button(label, options = {}, &block) ⇒ Object



17
18
19
20
# File 'app/helpers/bootstrap/view_helpers/button_helper.rb', line 17

def bs_checkbox_button(label, options = {}, &block)
  options = options.merge(label: label, type: :checkbox)
  Components::Button.build(self, options, &block).to_html
end


10
11
12
13
14
15
# File 'app/helpers/bootstrap/view_helpers/button_helper.rb', line 10

def bs_link_to(name = nil, path_opts = nil, opts = nil, &block)
  options, path_opts, name = path_opts, name, block if block_given?
  options ||= opts || {}
  options = options.merge({ href: path_opts, label: name, type: :link })
  Components::Button.build(self, options).to_html
end

#bs_radio_button(label, options = {}, &block) ⇒ Object



22
23
24
25
# File 'app/helpers/bootstrap/view_helpers/button_helper.rb', line 22

def bs_radio_button(label, options = {}, &block)
  options = options.merge(label: label, type: :radio)
  Components::Button.build(self, options, &block).to_html
end