title: Redirect to appropriate pages after logging in
body: <p>I have installed devise and activeadmin gem. When I try to login via client then I get redirected to the right page but when I try to login via admin I get redirected to the client login page. </p>
  
  <h3>routes.rb</h3>
  
  <pre><code> namespace :admin do
          # get "/stats" =&gt; "stats#stats"
          devise_scope :admin_user do
            get '/stats/:scope' =&gt; "stats#stats", as: :admin_stats
          end
        end
  
        devise_for :admin_users, ActiveAdmin::Devise.config
        ActiveAdmin.routes(self)
        namespace :client do
          get 'dashboard' =&gt; 'dashboard#index', as: 'dashboard'
        end
  
        devise_for :users, class_name: 'FormUser', controllers: { omniauth_callbacks: 'omniauth_callbacks', registrations: 'registrations' }
        devise_scope :user do
          root to: 'devise/registrations#new'
        end
  </code></pre>
  
  <h3>application_controller.rb</h3>
  
  <pre><code>def after_sign_in_path_for(resource_or_scope)
      client_dashboard_path
    end
  
    def after_sign_out_path_for(resource_or_scope)
      root_path
    end
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>Here is a link to the test app <a href="http://rsslotto.herokuapp.com" rel="nofollow">enter link description here</a></p>
  
  <p>Admin login <a href="http://rsslotto.herokuapp.com/admin" rel="nofollow">enter link description here</a></p>