开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜