Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CanCan ruby on rails error

I'm just starting a new project in Rails and I wanted to add some CanCan roles checking to app. What have I done: 1. Installed proper gem 2. Included in gemfile "cancan" 3. Created ability class 4. In my ApplicationController - added "check_authorization"

But still, I get

undefined local variable or method `authorize_resource' for ApplicationController:Class

or

undefined local variable or method `check_authorization' for ApplicationController:Class

error. Somebody got any ideas what can be the reason why?

My cancan version is 1.6.7. Gem version is 1.9.1

like image 876
Animattronic Avatar asked May 22 '26 22:05

Animattronic


1 Answers

As the author @Animattronic said, restart your Rails server.

like image 75
Nate Avatar answered May 25 '26 15:05

Nate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!