Make sure Cancancan actually finds the resource to authorize it
This commit is contained in:
parent
13bf57d132
commit
756cd09fa5
1 changed files with 1 additions and 1 deletions
|
@ -2,7 +2,7 @@ class RequestsController < ApplicationController
|
|||
load_and_authorize_resource :user, find_by: :name
|
||||
|
||||
before_action :load_request, only: [:confirm, :decline]
|
||||
authorize_resource :request, only: [:confirm, :decline]
|
||||
authorize_resource :request, id_param: :request_id, only: [:confirm, :decline]
|
||||
|
||||
def index
|
||||
@requests = @user.incoming_requests.group_by(&:status)
|
||||
|
|
Loading…
Reference in a new issue