I'm using devise for authentication and have some before_filters in my application controller. Issue I'm seeing is that when I try to logout the before_filter intercepts that and keeps me on the view that's I've setup in the before_filter. Is there any way for me to specify which controllers should be excluded from the application controller or some other file?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Strong parameter override for DeviseTokenAuth cont
- Eager-loading association count with Arel (Rails 3
- Is there a way to remove IDV Tags from an AIFF fil
相关文章
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
- Rspec controller error expecting <“index”> but
In config/application.rb
Referenced by:
How to skip a before_filter for Devise's SessionsController?
You can qualify a filter with
:only
or:except
.Or if the filter (as I now see is the case in your situation) is defined in
ApplicationController
and you want to bypass it in a subclass controller, you can use askip_before_filter
with the same qualifications in the subclass controller:Answers above are good except:
DEPRECATION WARNING: skip_before_filter is deprecated and will be removed in Rails 5.1. Use skip_before_action instead.
So please use
before_action
andskip_before_action
instead of*-filter
.In the controller where you want to skip a before filter specified in an inherited controller, you can tell rails to skip the filter