ruby on rails - Skip registrations in devise_token_auth -


i'm using devise_token_auth want have put , delete actions available registration.

right i'm doing this:

rails.application.routes.draw   concern :api_endpoints     mount_devise_token_auth_for 'user', at: 'users', skip: [:registrations]     :users       put 'users', to: 'devise_token_aut/registrations#update'       delete 'users', to: 'devise_token_auth/registrations#destroy'     end     resources :orders, only: [:index]     post 'sign_up', to: 'inactive_users#create'   end    namespace :api, defaults: { format: :json }     namespace :v1       concerns :api_endpoints     end   end end 

and gives me routes:

                      prefix verb   uri pattern                              controller#action      new_api_v1_user_session    /api/v1/users/sign_in(.:format)          devise_token_auth/sessions#new {:format=>:json}         #some other routes...                           api_v1_users put    /api/v1/users(.:format)                  api/v1/devise_token_aut/registrations#update {:format=>:json}                              delete /api/v1/users(.:format)                  api/v1/devise_token_auth/registrations#destroy {:format=>:json} 

the uri pattern last routes 1 want, want them point controllers devise_token_aut/registrations#update, without api/v1.

how can keep api/v1 part in uri not in controller?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -