Concevoir: edit_password_url de réinitialisation de mot de passe e-mail est à envoyer à l'usager à l'url/api/v1/

J'ai mon application rails et de Concevoir configuré pour utiliser une API JSON à faire de l'utilisateur d'inscription et de connexion. Un effet secondaire est que edit_password_url dans l'e-mail de réinitialisation de mot de passe est accidentellement à l'envoi aux utilisateurs de:

 http://localhost:3000/api/v1/password/edit?reset_password_token=ZzyPCgmspN2964ENUkSS 

quand il ne devrait pas avoir api/v1/, et doit l'envoyer à:

http://localhost:3000/password/edit?reset_password_token=ZzyPCgmspN2964ENUkSS

J'ai été à la recherche, mais ne peut pas trouver de résoudre ce problème.

J'ai créé le suivant:

Api::V1::SessionsController < Devise::SessionsController 

et

Api::V1::RegistrationsController < RegistrationsController

J'ai régulièrement RegistrationsController qui hérite de concevoir, mais n'est pas régulier SessionsController, donc je viens d'hériter directement de concevoir.

Merci pour l'aide!

EDIT:

routes.rb

namespace :api, defaults: {format: 'json'} do
    namespace :v1 do
      resources :users
      devise_for :users, :path => '', path_names: {sign_in: "login", sign_out: "logout"},
                                      controllers: {  omniauth_callbacks: "authentications", registrations: "registrations"}
    end
  end

devise_for :users, :path => '', path_names: {sign_in: "login", sign_out: "logout"},
                                  controllers: {  omniauth_callbacks: "authentications", registrations: "registrations"}

  resources :users

EDIT 2: rake routes sortie

        new_api_v1_user_session GET      /api/v1/login(.:format)                                    api/v1/sessions#new {:format=>"json"}
api_v1_user_session POST     /api/v1/login(.:format)                                    api/v1/sessions#create {:format=>"json"}
destroy_api_v1_user_session DELETE   /api/v1/logout(.:format)                                   api/v1/sessions#destroy {:format=>"json"}
api_v1_user_omniauth_authorize GET|POST /auth/:provider(.:format)                                  authentications#passthru {:provider=>/twitter|facebook/, :format=>"json"}
api_v1_user_omniauth_callback GET|POST /auth/:action/callback(.:format)                           authentications#(?-mix:twitter|facebook) {:format=>"json"}
api_v1_user_password POST     /api/v1/password(.:format)                                 api/v1/passwords#create {:format=>"json"}
new_api_v1_user_password GET      /api/v1/password/new(.:format)                             api/v1/passwords#new {:format=>"json"}
edit_api_v1_user_password GET      /api/v1/password/edit(.:format)                            api/v1/passwords#edit {:format=>"json"}
PUT      /api/v1/password(.:format)                                 api/v1/passwords#update {:format=>"json"}
cancel_api_v1_user_registration GET      /api/v1/cancel(.:format)                                   registrations#cancel {:format=>"json"}
api_v1_user_registration POST     /api/v1(.:format)                                          registrations#create {:format=>"json"}
new_api_v1_user_registration GET      /api/v1/sign_up(.:format)                                  registrations#new {:format=>"json"}
edit_api_v1_user_registration GET      /api/v1/edit(.:format)                                     registrations#edit {:format=>"json"}
PUT      /api/v1(.:format)                                          registrations#update {:format=>"json"}
DELETE   /api/v1(.:format)                                          registrations#destroy {:format=>"json"}
sessions GET      /sessions(.:format)                                        sessions#index
POST     /sessions(.:format)                                        sessions#create
new_session GET      /sessions/new(.:format)                                    sessions#new
edit_session GET      /sessions/:id/edit(.:format)                               sessions#edit
session GET      /sessions/:id(.:format)                                    sessions#show
PUT      /sessions/:id(.:format)                                    sessions#update
DELETE   /sessions/:id(.:format)                                    sessions#destroy
authentications GET      /authentications(.:format)                                 authentications#index
POST     /authentications(.:format)                                 authentications#create
new_authentication GET      /authentications/new(.:format)                             authentications#new
edit_authentication GET      /authentications/:id/edit(.:format)                        authentications#edit
authentication GET      /authentications/:id(.:format)                             authentications#show
PUT      /authentications/:id(.:format)                             authentications#update
DELETE   /authentications/:id(.:format)                             authentications#destroy
new_user_session GET      /login(.:format)                                           devise/sessions#new
user_session POST     /login(.:format)                                           devise/sessions#create
destroy_user_session DELETE   /logout(.:format)                                          devise/sessions#destroy
user_omniauth_authorize GET|POST /auth/:provider(.:format)                                  authentications#passthru {:provider=>/twitter|facebook/}
user_omniauth_callback GET|POST /auth/:action/callback(.:format)                           authentications#(?-mix:twitter|facebook)
user_password POST     /password(.:format)                                        devise/passwords#create
new_user_password GET      /password/new(.:format)                                    devise/passwords#new
edit_user_password GET      /password/edit(.:format)                                   devise/passwords#edit
PUT      /password(.:format)                                        devise/passwords#update
cancel_user_registration GET      /cancel(.:format)                                          registrations#cancel
user_registration POST     /                                                          registrations#create
new_user_registration GET      /sign_up(.:format)                                         registrations#new
edit_user_registration GET      /edit(.:format)                                            registrations#edit
PUT      /                                                          registrations#update
DELETE   /                                                          registrations#destroy

EDIT 3:

Donc j'ai pu en tester quelques chose, et d'en concevoir modèle d'e-mail, le chemin edit_password_url est là, et travaille pour générer le ci-dessus url erronée, mais quand je fais rake routes, seulement edit_user_password_url existe.

OriginalL'auteur Arel | 2013-08-15