Posted By

smoothdzion on 11/24/09


select html rails ruby ror

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


RoR - Select Box Using Existing Model

 / Published in: Rails

The code to find all objects from a model and use them as select options.

  1. # Replace |model| with whatever you want to use. ie. |whatever|
  2. <%= select(:object, :name, Model.all.collect {|model| [,]}) %>

Report this snippet  

You need to login to post a comment.