In my application in user registration I have a country picker..
<%= select(:user, :country, options_for_select(@COUNTRIES)) %>
And I want to add a prompt as a first default value (something like "--- select country ---"). Where and how should I put this option?
Use the FormHelper :prompt
select(:user, :country, options_for_select(@COUNTRIES), {:prompt => "--select county--"})
http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With