-
Notifications
You must be signed in to change notification settings - Fork 783
NameError in Controller + Pluralize #880
Comments
I realized my error and stopped using 'load_and_authorize_resource' and started using the application controller line 'enable_authorization' but it's still broken because now I get segmentation faults, crashing the server. Ability.rb if user.admin?
can :access, :all
else
can :access, :imoveis
end ApplicationController class ApplicationController < ActionController::Base
enable_authorization So, as a guest user, when I try to access '/imoveis' or any other url besides '/imoveis/new' I get a segmentation fault. When I try to access '/imoveis/new' I get this error:
And this is a small log of the segfault:
|
Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013. CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994. If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan. We hope to see you on the other side! |
When you have a controller named differently from rails pluralize pattern (i.e. "Imovel" model and "Imoveis" controller) you will get this error because CanCan tries to reference a model named "Imovei".
Dunno if it was clear enough but I can provide more details if needed.
Using CanCan 2.0 btw
The text was updated successfully, but these errors were encountered: