私はcancanを使用していますが、少し問題があります..
my ability.rb
can :manage, Department
can :manage, Review
ケース1では機能しますが、残念ながらケース2では機能しない2つのケースがあります
case 1
私の部署のコントローラー
load_and_authorize_resource :message => "Unable to read this article."
Here it works because in this controller
I use model Department
今、私のレビューコントローラー
case 2
class ReviewsController < ApplicationController
load_and_authorize_resource :message => "Unable to read this article."
layout 'system'
respond_to :html, :json
add_breadcrumb "Home", :root_url
add_breadcrumb "Reviews", :reviews_path
def index
@page_title = "Reviews List"
@reviews = Evaluate.all
end
def show
@page_title = "Review setting of selected Job title"
@review = Evaluate.find(params[:id])
end
どうすればこの問題を解決できますか?
Is there a fix rule in cancan that model name
should be related to the controller name?
Departments(controller) should have Department(model)?
How can we implement cancan in Reviews(controller) which have Evaluate(model)?