Mmmm.. I still seem to be getting the same error message.
This is my controller create_user
def create_user
@user = User.new(params[:user])
if @user.save
render :update do |rjs|
rjs.replace_html :userlist, :partial => 'user_list'
flash[:notice] = "User was added successfully"
end
else
redirect_to_index("<font color='red'>Error</font>")
end
end
Mmmm.. I still seem to be getting the same error message.
This is my controller create_user
def create_user
That's a very non-standard name. "create" is the usual name for the
method that does this.
@user = User.new(params[:user])
if @user.save
render :update do |rjs|
rjs.replace_html :userlist, :partial => 'user_list'
flash[:notice] = "User was added successfully"
end
else
redirect_to_index("<font color='red'>Error</font>")
end
end
You still haven't initialized @users. (Did you see Phil's response?)
You're using an uninitialized variable in the view. It can't read your
mind If you want it to contain an array of User objects, you have
to assign it the array.
That's the javascript generated by your rjs. Your action always
renders javascript and so if it requested by a normal request it will
just display the javascript
Something wrong with my form??
Yes, you're nesting a form inside a form. Don't do that.