# Uninitialized constant UsersController::User

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-userscontroller-user/151901>\
**Category:** Ruby\
**Created:** [October 27, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-userscontroller-user/151901 "2008-10-27T17:32:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxer](https://www.ruby-forum.com/u/maxer)\
**Post date:** [October 27, 2008, 5:32pm UTC](https://www.ruby-forum.com/t/uninitialized-constant-userscontroller-user/151901/1 "2008-10-27T17:32:33Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![maxer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e47774/32.png) [@maxer](https://www.ruby-forum.com/u/maxer)\
**Post date:** [October 28, 2008, 7:02am UTC](https://www.ruby-forum.com/t/uninitialized-constant-userscontroller-user/151901/2 "2008-10-28T07:02:17Z")

</div>

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/](http://rubyonrails.com/)

James
