Class: BootstrapFormHelper::FormControls
- Inherits:
-
ActionView::Helpers::FormBuilder
- Object
- ActionView::Helpers::FormBuilder
- BootstrapFormHelper::FormControls
- Defined in:
- lib/bootstrap_form_helper/form_builder.rb
Instance Method Summary collapse
- #check_box(attribute, text, options = {}, checked_value = 1, unchecked_value = 0) ⇒ Object
- #radio_button(attribute, value, text = nil, options = {}) ⇒ Object
Instance Method Details
#check_box(attribute, text, options = {}, checked_value = 1, unchecked_value = 0) ⇒ Object
148 149 150 151 152 153 154 155 156 157 |
# File 'lib/bootstrap_form_helper/form_builder.rb', line 148 def check_box(attribute, text, = {}, checked_value = 1, unchecked_value = 0) klasses = 'checkbox' klasses += ' inline' if .delete :inline @template.label_tag nil, class: klasses do @template.concat super(attribute, , checked_value, unchecked_value) @template.concat text yield if block_given? end end |
#radio_button(attribute, value, text = nil, options = {}) ⇒ Object
159 160 161 162 163 164 165 166 167 168 |
# File 'lib/bootstrap_form_helper/form_builder.rb', line 159 def (attribute, value, text = nil, = {}) klasses = 'radio' klasses += ' inline' if .delete :inline @template.label_tag nil, class: klasses do @template.concat super(attribute, value, ) @template.concat text || value.to_s.humanize.titleize yield if block_given? end end |