I am trying to make the default value for the country input in a form to be “United States”. I am using the simple form gem and country select gem.
In the simple form initializer, I set this default
config.country_priority = [ "United States" ]
Which makes the topmost value correct as United States, but the default value is ‘Uganda’.
In the _form view, I did the following:
<%= f.input :country, :default => [ 'United States' ] %>
I restarted Rails and it still defaulted to Uganda.
I also tried the following:
<%= f.input :country, :default => 'United States' %>
and
<%= f.input :country, :selected => 'United States' %>
What should I try next?
I ended up not using the gem — too much complexity. I just created a constant COUNTRIES and used that instead.