I can''t figure out why model methods disappear after the first page request? If I restart Webrick, I can load the page once, without error, but refresh the page, and I keep getting method missing errors. My code is extremely simple: class LineItem < ActiveRecord::Base belongs_to :order end class Order < ActiveRecord::Base has_many :line_items end --> index.rhtml <%= @line_item.order.id %> Error is like method "order" missing for <LineItem:#29932... This is in development mode, Rails 1.2, Windows 2000, Webrick Help! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What code do you have in your controller? M<>< -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of blakeage Sent: Wednesday, February 14, 2007 8:39 AM To: Ruby on Rails: Talk Subject: [Rails] Model method disappear after first page request I can''t figure out why model methods disappear after the first page request? If I restart Webrick, I can load the page once, without error, but refresh the page, and I keep getting method missing errors. My code is extremely simple: class LineItem < ActiveRecord::Base belongs_to :order end class Order < ActiveRecord::Base has_many :line_items end --> index.rhtml <%= @line_item.order.id %> Error is like method "order" missing for <LineItem:#29932... This is in development mode, Rails 1.2, Windows 2000, Webrick Help! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nothing, except for the scaffold_resource inserted code, like respond_to html... It''s in the index action, and I''m using the REST architecture. My index.rhtml source is like: <% for acc in @user.accounts %> <% for line_item in acc.line_items %> <%= line_item.order.id %> <% end %> <% end %> Note: You can pull back the line items by account, as each LineItem has an AccountID On Feb 14, 11:46 am, "Mark Carey" <l...-MMYp1bZq/KasTnJN9+BGXg@public.gmane.org> wrote:> What code do you have in your controller? > > M<>< > > -----Original Message----- > From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of blakeage > Sent: Wednesday, February 14, 2007 8:39 AM > To: Ruby on Rails: Talk > Subject: [Rails] Model method disappear after first page request > > I can''t figure out why model methods disappear after the first page > request? If I restart Webrick, I can load the page once, without > error, but refresh the page, and I keep getting method missing > errors. My code is extremely simple: > > class LineItem < ActiveRecord::Base > belongs_to :order > end > > class Order < ActiveRecord::Base > has_many :line_items > end > > --> index.rhtml > <%= @line_item.order.id %> > > Error is like method "order" missing for <LineItem:#29932... > > This is in development mode, Rails 1.2, Windows 2000, Webrick > > Help!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---