i came across this post by s.ross and i am having a similar problem. but mine is related to output. <http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/ 3f3a0f4b1e8ab157/e5d055c888a155da?lnk=gst&q=multiple +belongs_to#e5d055c888a155da> in his example his he has multiple associations class Bug < ActiveRecord::Base belongs_to :reporter, :class_name=>''User'', :foreign_key => ''reporter_id'' belongs_to :assignee, :class_name=>''User'', :foreign_key => ''assigned_to_id'' everything works great, in console but in the app. @bugs = Bug.find :all for errors in @bugs errors.date - no problem works fine errors.reporter.name - gets an error errors[45].reporter.name - works fine what am i doing wrong this works in console ie: @bugs = Bug.find :all one_error = @bugs[45] one_error.date (good) one_error.reporter.name (good) one_error.assignee.name (good) it has to be something simple. tia --~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
does anyone have an idea on this. i have check all the capitalization variable.association.assocation_variable i really need some pointers on this. On Apr 6, 2:24 pm, rashantha <rashan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i came across this post by s.ross and i am having a similar problem. > but mine is related to output. > > <http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/ > 3f3a0f4b1e8ab157/e5d055c888a155da?lnk=gst&q=multiple > +belongs_to#e5d055c888a155da> > > in his example his he has multiple associations > > class Bug < ActiveRecord::Base > belongs_to :reporter, :class_name=>''User'', :foreign_key => > ''reporter_id'' > belongs_to :assignee, :class_name=>''User'', :foreign_key => > ''assigned_to_id'' > > everything works great, in console but in the app. > > @bugs = Bug.find :all > for errors in @bugs > errors.date - no problem works fine > errors.reporter.name - gets an error > errors[45].reporter.name - works fine > > what am i doing wrong > > this works in console > ie: > > @bugs = Bug.find :all > one_error = @bugs[45] > one_error.date (good) > one_error.reporter.name (good) > one_error.assignee.name (good) > > it has to be something simple. tia--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Can you give us a concrete version of it, rather than this abstract version? Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) VIDEO #3 OUT APRIL 6 http://sensei.zenunit.com/ On 07/04/2008, at 12:45 PM, rashantha wrote:> > does anyone have an idea on this. > > i have check all the capitalization > > variable.association.assocation_variable > > i really need some pointers on this. > > On Apr 6, 2:24 pm, rashantha <rashan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> i came across this post by s.ross and i am having a similar problem. >> but mine is related to output. >> >> <http://groups.google.com/group/rubyonrails-talk/browse_thread/ >> thread/ >> 3f3a0f4b1e8ab157/e5d055c888a155da?lnk=gst&q=multiple >> +belongs_to#e5d055c888a155da> >> >> in his example his he has multiple associations >> >> class Bug < ActiveRecord::Base >> belongs_to :reporter, :class_name=>''User'', :foreign_key => >> ''reporter_id'' >> belongs_to :assignee, :class_name=>''User'', :foreign_key => >> ''assigned_to_id'' >> >> everything works great, in console but in the app. >> >> @bugs = Bug.find :all >> for errors in @bugs >> errors.date - no problem works fine >> errors.reporter.name - gets an error >> errors[45].reporter.name - works fine >> >> what am i doing wrong >> >> this works in console >> ie: >> >> @bugs = Bug.find :all >> one_error = @bugs[45] >> one_error.date (good) >> one_error.reporter.name (good) >> one_error.assignee.name (good) >> >> it has to be something simple. tia > >--~--~---------~--~----~------------~-------~--~----~ 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---