Module: Basecoat::FormBuilder
- Defined in:
- lib/basecoat/form_builder.rb
Instance Method Summary collapse
- #basecoat_country_select(method, options = {}) ⇒ Object
- #basecoat_select(method, choices, options = {}, html_options = {}) ⇒ Object
Instance Method Details
#basecoat_country_select(method, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/basecoat/form_builder.rb', line 13 def basecoat_country_select(method, = {}) value = @object.public_send(method) if @object = .merge(selected: value) if value name = "#{@object_name}[#{method}]" @template.basecoat_country_select_tag(name, ) end |
#basecoat_select(method, choices, options = {}, html_options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/basecoat/form_builder.rb', line 3 def basecoat_select(method, choices, = {}, = {}) value = @object.public_send(method) if @object = .merge(selected: value) if value name = "#{@object_name}[#{method}]" [:group_label] ||= method.to_s.titleize.pluralize @template.basecoat_select_tag(name, choices, ) end |