skip_before_action and Rails 5 skip_before_action and Rails 5 ruby ruby

skip_before_action and Rails 5


According to this thread

ActiveSupport::Callbacks#skip_callback now raises an ArgumentError if an unrecognized callback is removed.

So your solution is to pass raise: false option to skip_before_action:

skip_before_action :redirect_heroku_user, raise: false

See the changelog for more info.


In Rails 5, if the method redirect_heroku_user is not defined in the same controller, then it raises this exception.

You can pass raise: false to avoid it as mentioned here:

skip_before_action :redirect_heroku_user, only: :edit, raise: false