Jon Cox wrote:
> 
>> --------------------Myprojects controller--------------------
>> class MyprojectsController < ApplicationController
>>   def index
>>     @myprojects = current_user.Project.all   #<-------- 'Project'
>> reference here is getting an undefined method error
>> 
>>     respond_to do |format|
>>       format.html # index.html.erb
>>       format.xml  { render :xml => @myprojects }
>>     end
>>   end
> 
> Would that not need to read
> 
> @myprojects = current_user.projects.all

Or just current_user.projects , since that already returns a collection.

> 
> PS i'll be impressed if i'm right being new to rails myself! :)

Then prepare to be impressed.  Good catch!

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to