Rails : form select helper to have a starting default
forms, helper, ruby, ruby-on-rails
Solution
Have you tried selected option
:selected => "United Kingdom" or your_country_id
not sure about the syntax but hopefully it would work
Problem
I have a simple form. Also as part of the form I have a variable with an array/list of all the country names. The form picks up the list just fine, however, it starts off on the first value, I think its `Afghanistan`, however I want it to start/default with `United Kingdom` This is my code for the form select for the countries. ``` <%= f.select(:country, @country_list.map { |value| [ value, value ] }) %> ``` I have tried without success: ``` <%= f.select(:country, @country_list.map { |value| [ value, value ] },['United Kingdom']) %> ```