I am using Rails 3.2, Devise and Cancan for an application with 3 user categories: Companies, Customers and Admins.
My problem is that I get this:
undefined local variable or method `current_user' for #<HomeController:0xb4fd217c>
In HomeController I have:
class HomeController < ApplicationController
before_filter :authenticate_customer!
load_and_authorize_resource :class => false
def index
render 'index'
end
end
Also, in the view:
- content_for :title, 'Home'
= link_to('Logout', destroy_customer_session_path, :method => :delete)
I am not calling current_user anywhere in my code.
Any ideas?
current_abilitymethod in yourApplicationController, per this GitHub issue. - Jim Stewartcurrent_useris referenced will need to be changed tocurrent_customer, but you say you're not referencingcurrent_useranywhere. - Jim Stewart