While skipping CSRF or authentication callbacks on certain methods in a controller, it is recommended to pass the method names explicitly using the only
option instead if the except
option.
This way you can ensure that these callbacks are skipped only for the method names passed and that there are no unintended security loopholes.
class PeopleController < ApplicationController
skip_before_action :verfiy_authenticity_token, except: [:index, :show]
# ...
end
class PeopleController < ApplicationController
skip_before_action :verfiy_authenticity_token, only: [:index, :show]
# ...
end