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, options = {}, html_options = {}, additional_country = nil)
  @countries ||= (additional_country ? [additional_country] : []) + Country.find(:all, :order => 'sort, name asc')
  self.menu_select(method, I18n.t('muck.engine.choose_country'), @countries, options.merge(:prompt => I18n.t('muck.engine.select_country_prompt'), :wrapper_id => 'countries-container'), html_options.merge(:id => 'countries'))
end