Ruby on Rails Tuesday, May 30, 2017

I'm creating a new PressRelease  the PressRelease model has no club_id column it has columns like venue, venue_city, venue_state, etc. I wanna add a collection_select to the form to get a club_id into the params from the Club model How should my collection_select be constructed I have something like  <%= f.collection_select(:club_id, Club.all, :id, :club, prompt: true) %> but this causes an undefined method 'club_id' error

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7f636bca-f73d-477f-8687-ae91019a2547%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment