uninitialized constant UsersController::User

C

Claudio Manuel

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
 
J

James Britt

Claudio said:
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/


James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top