I'm already using :before_filte开发者_如何学运维r :authenticate_user! from devise but I would like to add another filter in my controllers after authenticate_user! passes. After the user authenticates I would like to check if some attribute in User is set to true, if not then I would like to redirect the user to some page.
Is there some guide or plugin to create a custom filter?
You can add another before_filter to your controller. A filter stops the chain if and only if it redirects or renders something, otherwise the next filter is executed.
See more on filters in the RailsGuides: http://guides.rubyonrails.org/action_controller_overview.html#filters
精彩评论