Forum: Ruby uninitialized constant UsersController::User

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D14d31e3212d060b2bd034953d52c8ef?d=identicon&s=25 Claudio Manuel (claudio)
on 2008-10-27 17:32
hi there
I am new to ruby. I got the following error when creating a registation
page.

NameError in UsersController#new
uninitialized constant UsersController::User

here is the trace:
C:/opt/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in
`const_missing'
app/controllers/users_controller.rb:4:in `new'

I am using : http://localhost:3000/users/new

here is the users_controller.rb

class UsersController < ApplicationController

  def new
   @user = User.new
  end

  def create
   @user = User.new(params[:user])

   if @user.save
     flash[:notice] = 'Thanks for signing up!'
     redirect_to :controller => 'events', :action => 'index'
   else
     render :action => 'new'
   end
  end

end


2)can someone recommends a book (Rest V2) that has lost of
examples/tutorials
so I can learn it the right way.
thanks
claudio
Ff9e18f0699bf079f1fc91c8d4506438?d=identicon&s=25 James Britt (Guest)
on 2008-10-28 07:02
(Received via mailing list)
Claudio Manuel wrote:
> app/controllers/users_controller.rb:4:in `new'
You might do better asking Rails questions on the Rails mailing list.

Should be listed on http://rubyonrails.com/


James
This topic is locked and can not be replied to.