Hi:
Sad question, I know. I saw it somewhere but can’t rediscover it. I
have a collection_select and want to add a prompt so the dropdown
displays “select one”
How is that done?
thanks.
bruce
Hi:
Sad question, I know. I saw it somewhere but can’t rediscover it. I
have a collection_select and want to add a prompt so the dropdown
displays “select one”
How is that done?
thanks.
bruce
bruce balmer wrote:
Hi:
Sad question, I know. I saw it somewhere but can’t rediscover it. I
have a collection_select and want to add a prompt so the dropdown
displays “select one”How is that done?
thanks.
bruce
<%= select(‘object’,‘method’,options, {:prompt => “Choose one”} %>
Make sure the ‘method’ attribute in your ‘objects’ table defaults to
NULL or this won’t work.
Use a verify_presence_of :method clause in your model to make sure the
user selects something.
I also find this handy… http://api.rubyonrails.com/
_Kevin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs