Uninitialized constant UsersController::User


#1

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:innew’

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


#2

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