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'

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):002:0> User.new
=> #<User id: nil, name: nil, email: nil, created_at: nil, updated_at: 
nil>
irb(main):003:0> user = User.new(:name => "Michael Hartl", :email => 
"[email protected]")
=> #<User id: nil, name: "Michael Hartl", email: "[email protected]", 
created_at: nil, updated_at: nil>

irb(main):006:0> user.save
  ←[1m←[35m (0.0ms)←[0m  SAVEPOINT active_record_1
  ←[1m←[36m (0.0ms)←[0m  ←[1mSELECT 1 FROM "users" WHERE 
LOWER("users"."email") = LOWER('[email protected]') LIMIT 1←[0m
  ←[1m←[35mSQL (0.0ms)←[0m  INSERT INTO "users" ("created_at", "email", 
"name", "updated_at") VALUES (?, ?, ?, ?)  [["created_at", Tue, 29 Nov 
2011 11:53:29 UTC +00:00], ["email", "[email protected]"
], ["name", "Michael Hartl"], ["updated_at", Tue, 29 Nov 2011 11:53:29 
UTC +00:00]]
  ←[1m←[36m (0.0ms)←[0m  ←[1mRELEASE SAVEPOINT active_record_1←[0m
=> true

irb(main):012:0> user.find(1)
NoMethodError: undefined method `find' for #<User:0x1d401b0>
        from 
C:/Ruby193/gems/activemodel-3.1.3/lib/active_model/attribute_methods.rb:385:in 
`method_missing'
        from 
C:/Ruby193/gems/activerecord-3.1.3/lib/active_record/attribute_methods.rb:60:in 
`method_missing'
        from (irb):12
        from 
C:/Ruby193/gems/railties-3.1.3/lib/rails/commands/console.rb:45:in 
`start'
        from 
C:/Ruby193/gems/railties-3.1.3/lib/rails/commands/console.rb:8:in 
`start'
        from C:/Ruby193/gems/railties-3.1.3/lib/rails/commands.rb:40:in 
`<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'



Why doesn't this site have something like code tags or something?!!! :)

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

Reply via email to