something wierd in Hartl newest tutorial

194 views
Skip to first unread message

Roelof Wobben

unread,
Nov 28, 2014, 9:00:20 AM11/28/14
to rubyonra...@googlegroups.com
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

Colin Law

unread,
Nov 28, 2014, 9:06:32 AM11/28/14
to rubyonra...@googlegroups.com
On 28 November 2014 at 14:00, Roelof Wobben <rwo...@hotmail.com> wrote:
> 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 :

I have not looked, but is it possible that you are supposed to fill
that bit yourself?

Colin

Roelof Wobben

unread,
Nov 28, 2014, 2:18:11 PM11/28/14
to rubyonra...@googlegroups.com
You are right.

Next time I wil do this sorts of things when I have more time.

Roelof


Op vrijdag 28 november 2014 15:06:32 UTC+1 schreef Colin Law:

Colin Law

unread,
Nov 28, 2014, 3:24:17 PM11/28/14
to rubyonra...@googlegroups.com
On 28 November 2014 at 19:18, Roelof Wobben <rwo...@hotmail.com> wrote:
> You are right.
>
> Next time I wil do this sorts of things when I have more time.

If you mean that you are not going to do the exercises because you do
not have enough time then that may be a false way of saving time. It
is not until you try the exercises that you know whether you have
understood the concepts.

Colin

>
> Roelof
>
>
> Op vrijdag 28 november 2014 15:06:32 UTC+1 schreef Colin Law:
>>
>> On 28 November 2014 at 14:00, Roelof Wobben <rwo...@hotmail.com> wrote:
>> > 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 :
>>
>> I have not looked, but is it possible that you are supposed to fill
>> that bit yourself?
>>
>> Colin
>
> --
> 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-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/a7e93ecf-1519-4dac-bffb-469af136425a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Roelof Wobben

unread,
Nov 28, 2014, 3:52:36 PM11/28/14
to rubyonra...@googlegroups.com
No,

I mean that I do not do the exercises if have for example 10 minutes free time.

Roelof


Op vrijdag 28 november 2014 21:24:17 UTC+1 schreef Colin Law:
Reply all
Reply to author
Forward
0 new messages