Q:

Devise in namespace - ActionController::RoutingError (No route matches {:action=>"new", :controller=>"devise/sessions"})

I'm using Devise and everything has been working great, but I am now trying to move things into an 'admin' namespace. 
I have a route that looks like: 
namespace :admin do
  devise_for :users, :controllers => { :registrations => "admin/users/registrations" }
end

In one of my controllers I have 
before_filter :authenticate_user! 

but when that gets called it throws: 
ActionController::RoutingError (No route matches {:action=>"new", :controller=>"devise/sessions"}): 

Any ideas?  

A:

As per the Devise documentation (which likely has changed since this posting), you could use the following instructions:
#    ...
#    
#    Notice that whenever you use namespace in the router DSL, it automatically sets the module. 
#    So the following setup:
#
#      namespace :publisher do
#        devise_for :account
#      end
#
#    Will use publisher/sessions controller instead of devise/sessions controller.  You can revert
#    this by providing the :module option to devise_for. 
#    
#    ...

Hope this helps someone.