この問題はこれまでに報告されていますが、まだ解決策が見つかりませんでした。Ruby on Rails - Deviseのサインアップリンクが動作しません - 未定義のメソッド `user_registration_path '
新しいRoRプロジェクトにDeviseプラグインをインストールしました。 (ライン#5の周りに)
undefined method `user_registration_path' for #<#<Class:0x007fd5d3503d58>:0x007fd5d3b0dcd0>
抽出されたソース:
http://localhost:3000/users/registration/sign_up
は、しかし、私は次のエラーを取得:私はサインアップリンクをクリックすると、私は次のルートにリダイレクトしています:
2: <h1>Sign up</h1>
3: </div>
4:
5: <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
6: <%= f.error_notification %>
7:
8: <div class="inputs">
私のルートは次のように生成します。
new_user_session GET /users/sign_in(.:format) devise/sessions#new
user_session POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session GET /users/sign_out(.:format) devise/sessions#destroy
password POST /users/password(.:format) devise/passwords#create {:name_prefix=>:user}
new_password GET /users/password/new(.:format) devise/passwords#new {:name_prefix=>:user}
edit_password GET /users/password/edit(.:format) devise/passwords#edit {:name_prefix=>:user}
PUT /users/password(.:format) devise/passwords#update {:name_prefix=>:user}
POST /users/registration(.:format) devise/registrations#create {:name_prefix=>"user_registration"}
new GET /users/registration/sign_up(.:format) devise/registrations#new {:name_prefix=>"user_registration"}
edit GET /users/registration/edit(.:format) devise/registrations#edit {:name_prefix=>"user_registration"}
PUT /users/registration(.:format) devise/registrations#update {:name_prefix=>"user_registration"}
DELETE /users/registration(.:format) devise/registrations#destroy {:name_prefix=>"user_registration"}
home_index GET /home/index(.:format) home#index
users GET /users(.:format) users#index
POST /users(.:format) users#create
new_user GET /users/new(.:format) users#new
edit_user GET /users/:id/edit(.:format) users#edit
user GET /users/:id(.:format) users#show
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
root / home#index
私のroutes.rbを次のコードを持っています
devise_for :users
get "home/index"
resources :users
root :to => "home#index"
私のroutes.rbをがdevise_forている私のためにそれを固定レール・サーバの再起動:ユーザーを。私はroutes.rbを含めるように私の質問を編集しました。何か案が? – Karan
それは賢明なバージョンでした!私は1.1.0 RCを使用していた – Karan
あなたの答えをありがとうtho :)あなたのroutes.rbの違いは、何かが私の考案の宝石で間違っていたかもしれないと私を指摘した。 – Karan