0
私はRails 4.2.7を使用しています。私は特定の条件の対象となるフィルタを定義したいと思います。私は自分のアプリケーションでページを訪問したときにだから私は私のbefore_filter句で未定義のメソッドを取得する
class ApplicationController < ActionController::Base
before_filter :store_last_page_visited unless logged_in?
…
private
def current_user
@current_user ||= User.find_by(id: session[:user_id])
end
def logged_in?
!current_user.nil?
end
def store_last_page_visited
session[:last_page_visited] = request.url
end
helper_method :current_user, :logged_in?
はしかし、私は私が指定したとき、私は私のフィルタが実行され得るように、異なる実行する必要がありますどのようなエラー
undefined method `logged_in?' for ApplicationController:Class Did you mean? logger
を取得していますか?