I have a select drop down in my Ui to display the Country names.
But i need United tates to be selected as default value.
I use country_select to populate the country names.
This is how i use <%= f.country_select :country, :selected=>'United
States' %>
i also tried
<%= f.country_select :country, :priority_countries=>'United States' %>
Do help me out to fix this..
Thanks in advance
Ratnavel.
--
Posted via http://www.ruby-forum.com/.
Thanks for the reply ebrad
I Used as this
<%= form.country_select :billing_country, ["United States"] %>, its
working..
BUT,
This is adding a option extra in the top as United states, the same
happened to me when i used the other two options which i mentioned
earlier..
Is it possible to show the United States in the list selected as
default.
Thank u Ryan I implemented in the same way as u both suggested...
Hi,
If you want to use the 'selected' option instead of putting it as a
priority country, you could try this
<%= form.country_select :billing_country, [], {:selected => "United
States"} %>
Liang Zan
I tried this, but still showing the first country ( afganestan ). do
you have any idea about that ?
thank you
<%= country_select(:contact_address1, :country) %>
<%= country_select(:contact_address2, :country) %>
The above is working..But the default is Afganistan..How can I change
this default to "UnitedStates"
Thanks in advance
Sijo