title: Can I use "devise_for", with "only" and "excepted"?
body: <p>I'm building a Rails website, and setting up the devise routes. So far, I have no trouble and everything works. However, since the website is divided between the administration and the visitor place, I would like the user to be able to edit his profile from a path that looks like <code>/admin/users/1/edit</code> and sign in/out from <code>/user/sign_in</code> or <code>user/sign_out</code> (without the <code>admin</code> prefixe).</p>
  
  <p>So far, I managed to do either with or without the prefix, but not both at the same time.</p>
  
  <p>Here is the relevant part of my route file:</p>
  
  <pre><code>devise_for :users, only: %w['session#new session#destroy']
  get '/admin' =&gt; 'home#admin', as: :admin
  
  authenticate :user do
    scope '/admin' do
      resource :basics
      resources :portfolios
      resources :articles
      devise_for :users, excepted: %w['sessions#new session#destroy']
    end
  end
  </code></pre>
  
  <p>And here is the result of <code>rake routes</code>:</p>
  
  <pre><code>new_user_session GET    /admin/users/sign_in(.:format)       devise/sessions#new
              user_session POST   /admin/users/sign_in(.:format)       devise/sessions#create
      destroy_user_session DELETE /admin/users/sign_out(.:format)      devise/sessions#destroy
         new_user_password GET    /admin/users/password/new(.:format)  devise/passwords#new
        edit_user_password GET    /admin/users/password/edit(.:format) devise/passwords#edit
             user_password PATCH  /admin/users/password(.:format)      devise/passwords#update
                           PUT    /admin/users/password(.:format)      devise/passwords#update
                           POST   /admin/users/password(.:format)      devise/passwords#create
  cancel_user_registration GET    /admin/users/cancel(.:format)        devise/registrations#cancel
     new_user_registration GET    /admin/users/sign_up(.:format)       devise/registrations#new
    edit_user_registration GET    /admin/users/edit(.:format)          devise/registrations#edit
         user_registration PATCH  /admin/users(.:format)               devise/registrations#update
                           PUT    /admin/users(.:format)               devise/registrations#update
                           DELETE /admin/users(.:format)               devise/registrations#destroy
                           POST   /admin/users(.:format)               devise/registrations#create
  </code></pre>
  
  <p>How can do this?</p>
  
  <p>Thank you in advance</p>