I have the following relationships:
class User < ActiveRecord::Base
class Picture < ActiveRecord::Base
And now I hace the following code:
@user = User.find params[:id] @picture = @user.pictures.new params[:picture]
But for user_id to be saved in my pictures db I have to add this line of
@picture.user_id = @user.id # should not need this... why?
That makes no sense. I though all this time the foreign key was
automatically stored. Am I going crazy?
Thanks for your input :-).