On 7 Dec 2011, at 14:01, Mathew Birch <[email protected]> wrote:

>> Then have a look at how to do use the debugger in Rails to inspect
>> your code as it runs.
> 
> Thanks a lot for everyone who has replied!
> 
> So I have started running the debugger and I get some weird results:
> 
> @item = Item.find_by_id(params[:id])
> (rdb:2) @item
> nil
> (rdb:2) Item.find_by_id(params[:id])
> #<Item id: 3, title: "Hello World!", location: "On the desk", comments: 
> "***", created_at: "2011-12-07 11:43:03", updated_at: "2011-12-07 11:43
> :03">
> 
> Anyone know why it isn't setting the result of 
> Item.find_by_id(params[:id]) to the variable @item although i 
> specifically tell it to do so:
> 
> @item = Item.find_by_id(params[:id])
> 

The debugger isn't quite an irb prompt (although you can get one by typing irb 
if my memory is correct)

Fred


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

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