On 7 December 2011 13:12, Mathew Birch <[email protected]> wrote:
> Frederick Cheung wrote in post #1035564:
>> So, at the risk of repeating myself, is @item nil?
>
> Shouldn't be... there are 4 items in the Item table.

riiiiight... but does one of have the id that you're selecting through
params? ;-)
If not, @item will be nil.

Try replacing :
  @item = Item.find_by_id(params[:id])
wiht
  @item = Item.find(params[:id])

...as find will raise an exception if it doesn't find a matching record.

Then have a look at how to do use the debugger in Rails to inspect
your code as it runs.

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