Include blank for first item in select list in options_for_select tag

I think you want this format:

select("model_name", "model_id", Model.all.collect {|mt| [ mt.name, mt.id ] }, {:include_blank => 'name of your blank prompt'})

BTW: was assuming Modle was suppose to be Model. To use using collection_select:

collection_select(:model, :model_id, Model.all, :id, :name, :prompt => true)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)