Specify load_and_authorize class to cancancan to avoid class loading errors
After adding new namespace `admin/local_census_records` cancancan `load_and_authorize` method started to crash because it was getting confused when loading and authorizing controller resources. Specifying class to load and authorize solves this situation.
This commit is contained in:
committed by
Javi Martín
parent
afd3644ace
commit
76e474db67
@@ -1,5 +1,5 @@
|
||||
class Admin::LocalCensusRecordsController < Admin::BaseController
|
||||
load_and_authorize_resource
|
||||
load_and_authorize_resource class: "LocalCensusRecord"
|
||||
|
||||
def index
|
||||
@local_census_records = @local_census_records.search(params[:search])
|
||||
|
||||
Reference in New Issue
Block a user