Can you show us the code that is not working?

Make sure you have the relationship specified in your model so Rails
knows it's there. so you should have

class Project < ActiveRecord::Base
  belongs_to :user
end

so that you can do:

Project.new :user => @user
or
Project.new :user_id => 12
and then after project.save:
project.user #=> #<User:...>
project.user_id #=> 12

On Jan 26, 6:16 pm, Souschef <[email protected]> wrote:
> I've added a foreign key to a table (specifically, user_Id to my
> projects table so I can select 'myprojects') and now when I add a
> project, the user_id is not being saved in the projects table.  In a
> former life, I would update my SQL statements, but this is rails.
> Where do I update my CRUD statements?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to