Ошибка:
NameError (uninitialized constant Ability::Invitation):
app/models/ability.rb:72:in `initialize'
app/controllers/invitations_controller.rb:12:in `new'
app/controllers/invitations_controller.rb:12:in `current_ability'
app/middleware/flash_session_cookie_middleware.rb:14:in `call'
В CanCan у меня есть:
can :manage, Invitation
в контроллере приглашений:
before_filter: current_ability # CanCanload_and_authorize_resource # CanCan
def current_ability @current_ability || = Ability.new (current_user, nil) end
Контроллер приложения:
#CanCan
def current_ability
@current_ability ||= Ability.new(current_user, nil) # since no group
end
Маршруты:
resources :invitations
Есть мысли, почему CanCan не счастлив?спасибо