rails-3-filters Blogs
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Kiprosh
is now part of
LawLytics
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Here's a way to add filters to your controllers without subclassing the Devise controllers. For example, I have a prepare_something method that I want to apply as a before_filter to all of the Devise controller actions. First, create a module in config/initializers/devise_filters.rb where we’ll implement a method to add all the filters to Devise that we want. We also need to make sure this module calls this method upon initialization so that our filters get added upon startup (this is important for the production environment). # Put this somewhere it will get auto-loaded, like