Answer the question
In order to leave comments, you need to log in
Adding a selection of existing records from another db table to the current one?
I can't figure out how, in the form of creating an entry in the albums table, you can add options for selecting groups from the corresponding model.
Answer the question
In order to leave comments, you need to log in
It would be more convenient if you published the code of your view, but if I understand you correctly, then something like this:
= form_for(@album) do |f|
= f.label :name
= f.text_field :name
= f.label :release_year
= f.number_field :release_year
= f.label :amount_of_member
= f.number_field :amount_of_member
= f.label :band
= f.collection_select :band_id, Band.all, :id, :name, prompt: 'Select a Band'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question