Rails form_for with collection_select Rails form_for with collection_select ruby-on-rails ruby-on-rails

Rails form_for with collection_select


You should just be able to use the regular select helper for something like that:

f.select :score, [['horrible', 1], ['poor', 2], ['mediocre', 3], ['good', 4], ['great', 5]]

You would use collection_select if you had a model for the scores. Something like:

f.collection_select :score_id, Score.all, :id, :name

See the API docs for collection_select