ruby on rails 5.0.0.1
を利用しています。
ログイン機能としてgem:devise
を利用しているのですが、以下route.rb
にて生成されるルートの中で、devise/registrations#new
を呼び出すためのルートnew_user_registration_path
を利用すると、以下エラーを出してしまいます。new_registration_path(resource_name)
を利用すれば、devise/registrations#new
を呼び出せるのですが、理由が分からず、ご指南頂けますと助かります。
ruby
1#routes.rb 2devise_for :users, :path => "user", controllers: { sessions: 'user/sessions' } 3 4 namespace :user do 5 root 'products#index' 6 get 'top' => 'top#index' 7 resource :account, only:[:show, :edit, :update] 8 resources :users do 9 resources :products 10 end 11 resources :products do 12 collection do 13 get "search" 14 get "voted" 15 end 16 member {patch "like", "unlike" } 17 resources :entries, only: [:create] do 18 patch :cancel, on: :member 19 end 20 resources :messages, except: [:edit] do 21 post :confirm, on: :collection 22 get :count, on: :collection 23 get :inbound, :outbound, :count, on: :collection 24 resource :reply, only: [ :new, :create ] do 25 post :confirm 26 end 27 end 28 patch :entries, on: :member 29 end 30 end
rails routes Prefix Verb URI Pattern Controller#Action new_user_session GET /user/sign_in(.:format) user/sessions#new user_session POST /user/sign_in(.:format) user/sessions#create destroy_user_session DELETE /user/sign_out(.:format) user/sessions#destroy user_password POST /user/password(.:format) devise/passwords#create new_user_password GET /user/password/new(.:format) devise/passwords#new edit_user_password GET /user/password/edit(.:format) devise/passwords#edit PATCH /user/password(.:format) devise/passwords#update PUT /user/password(.:format) devise/passwords#update cancel_user_registration GET /user/cancel(.:format) devise/registrations#cancel user_registration POST /user(.:format) devise/registrations#create new_user_registration GET /user/sign_up(.:format) devise/registrations#new
上記エラーを出すパス
ruby
1<%- if devise_mapping.registerable? && controller_name != 'registrations' %> 2 <%= link_to "Sign up", new_user_registration_path(resource_name) %><br /> 3<% end -%>
あなたの回答
tips
プレビュー