Rails: present a "choose from" to fill an attribute -


as first q on stackoverflow ... please gentle?

when assigning value attribute in table (f.e. projects, :project_owner), want present "choose from", consisting of objects table b (f.e. people, :person_name) , commit chosen 1 ...

so best practice?

thnx in advance ...

collection_select you:

<%= form_for @project |f| %>    <%= f.collection_select :owner_id, person.all, :id, :name %>    <%= f.submit %> <% end %> 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -