Module: HelpfulFields::FormBuilder
- Defined in:
- lib/helpful_fields.rb
Instance Method Summary collapse
- #check_box_with_label(field, label, options = {}) ⇒ Object
- #radio_button_with_label(field, value, label, options = {}) ⇒ Object
Instance Method Details
#check_box_with_label(field, label, options = {}) ⇒ Object
69 70 71 |
# File 'lib/helpful_fields.rb', line 69 def check_box_with_label(field, label, ={}) check_box(field, :id => [:id]) + label(field, label, :for => [:id]) end |
#radio_button_with_label(field, value, label, options = {}) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/helpful_fields.rb', line 73 def (field, value, label, ={}) unless id = [:id] object_s, fields_s, value_s = [@object_name, field, value].map{|f| @template.send(:sanitize_to_id, f) } id = "#{object_s}_#{fields_s}_#{value_s}" end (field, value, :id => id) + label('_', label, :for => id) end |