Super simple question… Im playing around in the rails console and am trying to pass the user id to a user_id column.
u = User.create(:name => "foo", :email => "bar")
Card.create(:user_id => u)
allways gives me user_id 1 no matter what the actual id is of the user.
I have my cards belonging to user and my user having many cards… but at the moment I have to explicitly use Card.create(:user_id => u.id)
I know I’m missing something painfully obvious here… I’m presuming declaring something in the controllers?
1 Answer