# Uninitialized constant UsersController::User

**URL:** <https://rubytalk.org/t/uninitialized-constant-userscontroller-user/49866>\
**Category:** ruby-talk\
**Created:** [27 October 2008 16:32 UTC](https://rubytalk.org/t/uninitialized-constant-userscontroller-user/49866 "2008-10-27T16:32:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudio\_Manuel](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@Claudio\_Manuel](https://rubytalk.org/u/Claudio_Manuel)\
**Post date:** [27 October 2008 16:32 UTC](https://rubytalk.org/t/uninitialized-constant-userscontroller-user/49866/1 "2008-10-27T16:32:10Z")

</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

&nbsp;&nbsp;def new  
&nbsp;&nbsp;&nbsp;@user = User.new  
&nbsp;&nbsp;end

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

&nbsp;&nbsp;&nbsp;if @user.save  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flash[:notice] = 'Thanks for signing up!'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;redirect\_to :controller =\> 'events', :action =\> 'index'  
&nbsp;&nbsp;&nbsp;else  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;render :action =\> 'new'  
&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![James\_Britt3](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@James\_Britt3](https://rubytalk.org/u/James_Britt3)\
**Post date:** [28 October 2008 06:01 UTC](https://rubytalk.org/t/uninitialized-constant-userscontroller-user/49866/2 "2008-10-28T06:01:28Z")

</div>

Claudio Manuel wrote:

> 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'

You might do better asking Rails questions on the Rails mailing list.

Should be listed on [http://rubyonrails.com/](http://rubyonrails.com/)

James
