I am using simple-form in rails and I would like to know if there is a way to change the way collection objects are displayed. For example I have something like this
<%= f.input :lang, :label => "Language", :collection => [ "en", "es, "zh", "fr" ] %>
Instead of showing up as "en es zh" etc I would like it to show up as "English Spanish" etc to the user. Is there anyway to do that sort of thing?
Thanks in advance.
You can use following way as well:
In Model:
LANGUAGES = {'English' => 'en','French' => 'fr'}
In View:
<%= f.input :lang, :label => "Language", :collection => Model::LANGUAGES %>