2013-08-02 17 views
19

登録に成功した後に確認ページを変更するには、この手順に従ってください。Rails 4 + Devise:既に使用されている無効なルート名

https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-(registration)

それが言うように私は全力を尽くすが、私はこのエラーを取得:

in `add_route': Invalid route name, already in use: 'new_user_session' (ArgumentError) 
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here: 
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created 

私はウィキがRailsの4と工夫を使用するために更新されていないと思いますが、私は十分周りに見つけることはありませんエラーを修正するための情報。

エラーが返される行は(routes.rbを)次である:

devise_for :users, :controllers => { :registrations => "registrations" } 

任意の提案?

ありがとうございました。

EDIT -

registrations_controller.rb

class RegistrationsController < Devise::RegistrationsController 

    protected 

    def after_inactive_sign_up_path_for(resource) 
     '/sign_up/inactive' 
    end 
end 

routes.rbを

root :to => 'home#index' 
devise_for :users 
resources :users 

devise_for :users, :controllers => { :registrations => "registrations" } 
+0

私は、あなたが「正確に言うこと」していないと言っています。あなたのコードを教えてください。 – sevenseacat

+0

私はあなたがすでにDeviseモジュールで定義されているsimmilar重複したconrollerを持っていると思います。 –

+0

お返事ありがとうございます。私はdevise wikiが言っているように、私のファイルの内容でメインポストを編集しました。 –

答えて

48

あなたのroutes.rbをして二つの経路devise_for :usersを持っている - 最初のものを除きます。

+0

ありがとう、私はその細部に気付かなかった。 –

関連する問題