NameError: uninitialized constant User::Registration

Problem with “Beginning Rails page 113:

I found a typo in the book too… it says:
Let’s generate the model and migration for the registration table now:
$ ./script/generate model registrations

it should say:
$ ./script/generate model registration

This causes problems later on when doing the following:
event = Event.find(:first)
user = create(:login => 'simon', :email => 'simon@example.com', :password => 'secret')
user.registrations.any?
NameError: uninitialized constant User::Registration

I had to figure that one out the hard way…

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Reddit
  • DZone
  • LinkedIn
  • StumbleUpon

Leave a Reply