会社、顧客、管理者の 3 つのユーザー カテゴリを持つアプリケーションに、Rails 3.2、Devise、および Cancan を使用しています。
私の問題は、これを取得することです:
undefined local variable or method `current_user' for #<HomeController:0xb4fd217c>
HomeController には次のものがあります。
class HomeController < ApplicationController
before_filter :authenticate_customer!
load_and_authorize_resource :class => false
def index
render 'index'
end
end
また、ビューで:
- content_for :title, 'Home'
= link_to('Logout', destroy_customer_session_path, :method => :delete)
コードのどこにも current_user を呼び出していません。
何か案は?