Skip before filter on Devise Controllers


Some times you need to skip some before filter actions on Devise Gem’s Controller.
For example you wants to check for subdomain or you applied some custom restrictions on site pages by using before_filters.

Its is very easy to skip methods on devise controllers call.

Steps:

In config/applictions.rb write something like this:


config.to_prepare do
 Devise::SessionsController.skip_before_filter :verify_is_admin, :authenticate_admin!
 Devise::PasswordsController.skip_before_filter :subdomain
end

and don’t forget to restart your server. 🙂

Advertisements

I am Senior Software Engineer. I love reading, writing, sharing,developing, hiking, movies, trips, mountains, brooks, hills etc.

Tagged with: , ,
Posted in Gems and plugins, Ruby Little Codes, Ruby on Rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

StackOverFlow
Categories
Archives
%d bloggers like this: