Ruby on Rails Friday, November 28, 2014

IM at chapter 2 exercises and then he asked if you can try this :

class User < ActiveRecord::Base
 
   has_many :microposts
  
   validates FILL_IN, presence: true
   validates FILL_IN, presence: true
  
end

but as soon as I do rails s I see this error messages :


Started GET "/users/4" for 82.74.205.109 at 2014-11-28 13:55:51 +0000
Processing by UsersController#show as HTML
  Parameters: {"id"=>"4"}
  User Load (0.4ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1  [["id", 4]]
  Rendered users/show.html.erb within layouts/application (1.3ms)
Completed 200 OK in 116ms (Views: 98.6ms | ActiveRecord: 0.4ms)

Started GET "/users" for 82.74.205.109 at 2014-11-28 13:55:53 +0000
Processing by UsersController#index as HTML
  User Load (0.3ms)  SELECT "users".* FROM "users"
  Rendered users/index.html.erb within layouts/application (4.7ms)
Completed 200 OK in 122ms (Views: 120.1ms | ActiveRecord: 0.3ms)

Started GET "/" for 82.74.205.109 at 2014-11-28 13:56:15 +0000
Processing by UsersController#index as HTML
Completed 500 Internal Server Error in 7ms
NameError (uninitialized constant User::FILL_IN):
  app/models/user.rb:5:in `<class:User>'
  app/models/user.rb:1:in `<top (required)>'
  app/controllers/users_controller.rb:7:in `index'

Is this a error in the tutorial or have I done something wrong ?

Roelof

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bc6cc131-8c0a-4ee5-ad2d-c44e4f31e874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment