Module: Bootstrap::ViewHelpers::ButtonHelper
- Defined in:
- app/helpers/bootstrap/view_helpers/button_helper.rb
Instance Method Summary collapse
- #bs_button(label, options = {}, &block) ⇒ Object
- #bs_checkbox_button(label, options = {}, &block) ⇒ Object
- #bs_link_to(name = nil, path_opts = nil, opts = nil, &block) ⇒ Object
- #bs_radio_button(label, options = {}, &block) ⇒ Object
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 (label, = {}, &block) [:label] = label Components::Button.build(self, , &block).to_html end |
#bs_checkbox_button(label, options = {}, &block) ⇒ Object
17 18 19 20 |
# File 'app/helpers/bootstrap/view_helpers/button_helper.rb', line 17 def (label, = {}, &block) = .merge(label: label, type: :checkbox) Components::Button.build(self, , &block).to_html end |
#bs_link_to(name = nil, path_opts = nil, opts = nil, &block) ⇒ Object
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) , path_opts, name = path_opts, name, block if block_given? ||= opts || {} = .merge({ href: path_opts, label: name, type: :link }) Components::Button.build(self, ).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 (label, = {}, &block) = .merge(label: label, type: :radio) Components::Button.build(self, , &block).to_html end |