On 29 November 2011 12:04, Somnath Mallick <[email protected]> wrote:
> Started GET "/users/1" for 127.0.0.1 at 2011-11-29 17:19:31 +0530
>  Processing by UsersController#show as HTML
>  Parameters: {"id"=>"1"}
>  User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" =
> ? LIMIT 1  [["id", "1"]]
> Completed 404 Not Found in 15ms
>
> ActiveRecord::RecordNotFound (Couldn't find User with id=1):
>  app/controllers/users_controller.rb:4:in `show'

Can you show us the code for users_controller show method.

>
> Rendered
> C:/Ruby193/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb
> (0.0ms)
> Rendered
> C:/Ruby193/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
> (30.0ms)
> Rendered
> C:/Ruby193/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
> within rescues/layout (45.1m)
>
> Now the strange thing is when i enter the find command i get an
> exception! Previously it was working fine.
>
> ...
>
> irb(main):012:0> user.find(1)

That should be User.find, you are calling find on the user object you
just created, instead of on the User class.

Colin

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