Method: MuckEngine::FormBuilder#country_select
- Defined in:
- lib/muck-engine/form_builder.rb
#country_select(method, options = {}, html_options = {}, additional_country = nil) ⇒ Object
creates a select control with countries. Default id is ‘countries’. If ‘retain’ is passed for the class value the value of this control will be written into a cookie with the key ‘countries’.
158 159 160 161 |
# File 'lib/muck-engine/form_builder.rb', line 158 def country_select(method, = {}, = {}, additional_country = nil) @countries ||= (additional_country ? [additional_country] : []) + Country.find(:all, :order => 'sort, name asc') self.(method, I18n.t('muck.engine.choose_country'), @countries, .merge(:prompt => I18n.t('muck.engine.select_country_prompt'), :wrapper_id => 'countries-container'), .merge(:id => 'countries')) end |