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

class Order < ActiveRecord::Base
has_many :line_items

–> index.rhtml
<%= %>

Error is like method “order” missing for <LineItem:#29932

This is in development mode, Rails 1.2, Windows 2000, Webrick



What code do you have in your controller?



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 %>
<%= %>
<% end %>
<% end %>

Note: You can pull back the line items by account, as each LineItem
has an AccountID