I'm having problems with the above. For description purposes, let's
just assume I have 3 models: User, Movie and Viewings, with the
following obvious fields:
users - name
movies - name
viewings - user_id, movie_id
I'm trying to use collection_select to create the appropriate pulldown,
but the following isn't working:
I'm having problems with the above. For description purposes, let's
just assume I have 3 models: User, Movie and Viewings, with the
following obvious fields:
users - name
movies - name
viewings - user_id, movie_id
I'm trying to use collection_select to create the appropriate pulldown,
but the following isn't working:
undefined method `viewings.movie_id' for #<User:0x23a32b8>
What am I missing?
At present, such chained method parameters in Active Record form
helpers won't work. You have to set @viewings = @user.viewings
and call collection_select(:viewings, :movie_id, @movies, :id, :name)