Method: MuckEngine::FormBuilder#language_select

Defined in:
lib/muck-engine/form_builder.rb

#language_select(method, options = {}, html_options = {}, additional_language = nil) ⇒ Object

creates a select control with languages. Default id is ‘languages’. If ‘retain’ is passed for the class value the value of this control will be written into a cookie with the key ‘languages’.



165
166
167
168
# File 'lib/muck-engine/form_builder.rb', line 165

def language_select(method, options = {}, html_options = {}, additional_language = nil)
  @languages ||= (additional_language ? [additional_language] : []) + Language.find(:all, :order => 'name asc')
  self.menu_select(method, I18n.t('muck.engine.choose_language'), @languages, options.merge(:prompt => I18n.t('muck.engine.select_language_prompt'), :wrapper_id => 'languages-container'), html_options.merge(:id => 'languages'))
end