我正在使用CanCan进行授权.我在/app/config/ability.rb中定义了模型动作用户规则,它的工作正常.我已经将load_and_authorize_resource行添加到我的application_controller中,一切都完成了.
但是,我也有许多视图和控制器没有下面的模型.例如,尝试加载统计页面
NameError (uninitialized constant Statistic): activesupport (3.2.3) lib/active_support/inflector/methods.rb:229:in `block in constantize' activesupport (3.2.3) lib/active_support/inflector/methods.rb:228:in `each' activesupport (3.2.3) lib/active_support/inflector/methods.rb:228:in `constantize' ...
CanCan有没有办法使用控制器动作而不是模型动作?