Undefined method `persistence_token_changed?'
Despite following the Railscast authlogic tutorial step by step, I'm running into an error when I try to register a new user.
开发者_运维百科NoMethodError in UsersController#create
Undefined method `persistence_token_changed?' for #<User:0x23d1c54>
My Users controller code is as follows:
class UsersController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new(params[:user])
if @user.save
flash[:notice] = "Successfully created user."
redirect_to root_url
else
render :action => 'new'
end
end
def edit
@user = current_user
end
def update
@user = current_user
if @user.update_attributes(params[:user])
flash[:notice] = "Successfully updated user."
redirect_to root_url
else
render :action => 'edit'
end
end
end
Any ideas? If you need to see anymore code, let me know. Stumped :/
Your error indicates you didn't define that variable or function. It's certainly not defined by the code you've posted here.
Maybe elaborate a bit.
精彩评论