I’m having a similar issue. Any one have any ideas?
You haven’t set an instance variable named @user.
Try this instead:
def update
@user = User.find_by_id(session[:user_id])
@user.attributes = params[:user]
flash[:message] = "User was successfully updated" and redirect_to :action => :index and return if @user.save
#If we didn't return, we couldn't save, so execute this alternate flash and render
flash[:message] = "Unable to save changes"
render :action => :edit
end
Alternatively, you could gang this action into the edit action with if request.post?
Niels