i just created an application to list the primary details of
userbut it is showing an error lik this
"uninitialized constant UsersController::User"
this is my controlller
class UsersController < ApplicationController
puts"hiiiiiiiii"
def index
puts"hiiiiiiiii"
@users = User.find(:all)
puts @users
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @users }
end
i �just �created an application �to list the �primary �details of
userbut it is �showing an error lik this
"uninitialized constant UsersController::User"
Is the user model defined in app/models/user.rb ?
yes it is defined in app/models/User.rb ?
i changed but now its showing this error
Showing app/views/users/index.html.erb where line #13 raised:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
Note you put the collection in @users, plural. The variable @user is
unset and thus nil, hence the error. You need to replace @user with
@users in the view.