I am creating a scaffold –
rails g scaffold Contact email:string email_provider:string
but I want the email provider to be a drop down (with gmail/yahoo/msn as options) and not a text field. How can I do this ?
drop-down-menuinputruby-on-railsruby-on-rails-3selectlist
I am creating a scaffold –
rails g scaffold Contact email:string email_provider:string
but I want the email provider to be a drop down (with gmail/yahoo/msn as options) and not a text field. How can I do this ?
Best Answer
You can take a look at the Rails documentation . Anyways , in your form :
As you can guess , you should predefine email-providers in another model -
Provider
, to have where to select them from .