Tim Shaffer wrote:
> On Aug 25, 9:09�pm, "Patrick L." <[email protected]> wrote:
>> Thanks much.
> This is part of your problem:
> 
> @user.jobs.find_by_user_id(@user.id, :all)
> 
> Since you are accessing jobs through the @user instance, you don't
> need to specify the "find by user id". Rails already knows to only
> find jobs associated with that user.
> 
> You can just do this: @user.jobs
> 
> And this: @user.jobs each do | job |
> 
> Make sure you have "has_many :jobs" in your User model. Didn't see
> that posted in your code.
> 
> Also, might not be a bad idea to familiarize yourself with the Rails
> Association documentation. It will answer a lot of questions like
> this.
> 
> http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html

Hi Tim,
I implemented your changes. Unfortunately, I still got the same error. I 
copied both the User and Jobs models, as well as the schema.rb file.

Please let me know your thoughts.

http://pastie.org/1116870
-- 
Posted via http://www.ruby-forum.com/.

-- 
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