Because we cannot guaranty that all controller have a index method, the given example in the readme of Pundit for a after_action checking the usage of the lib will raise exceptions in a default rails application.
This Pull requests changes the code example to use just a normal if statement to check the given action_name.
Starting with Rails 7.1 a new security check has been added; it checks whether referenced actions do exist for a given filter. (https://guides.rubyonrails.org/configuring.html#config-action-controller-raise-on-missing-callback-actions)
Because we cannot guaranty that all controller have a index method, the given example in the readme of Pundit for a
after_action
checking the usage of the lib will raise exceptions in a default rails application.This Pull requests changes the code example to use just a normal if statement to check the given
action_name
.