i have a database Country filled with (obvious) contries. now i would like to display them in the select_tag in my view (like a drop down list).
i tried puttin in options_for_select sth like @show_me_the_countries_mama.each do |f| ('[' + f.printable_name + ']' + ','). this would list countries each one of them in [] brackets and with spaces in normal view. but it doesnt work in options_for_select for doing the drop down list.
i have:
<% form_tag :method => 'get' do %> Country:<%= select_tag(:country, options_for_select([]))%> <%= submit_tag "Submit" %> <% end %>
how can i solve this? i somehow have to put an array of countries in options_for_select and now i am asking how should i do this. shoud i write separate method in the model for getting the proper array of countries and then inserting them here or..?
thank you for your answers