私は、今現在サインアップの動作後、指定したページに移動したいと考えているのですが、指定したページに移動していない状態にあります。もしわかる方がいらしたら、教えて頂きたいです。
今現在は、サインアップの動作後、plans_pathに移動してしまいます。(edit_guider_pathに移動したいのですが)
application_controller.rb
model
1def after_sign_up_path_for(resource) 2 edit_guider_path 3 end 4 5 def after_sign_in_path_for(resource) 6 plans_path(resource) 7 end 8 9 def after_sign_out_path_for(resource) 10 search_path(resource) 11 end 12end
routes
1Rails.application.routes.draw do 2 devise_for :tourists, controllers: { 3 4 sessions: 'tourists/sessions', 5 passwords: 'tourists/passwords', 6 registrations: 'tourists/registrations' 7 } 8 9 devise_for :guiders, controllers: { 10 sessions: 'guiders/sessions', 11 passwords: 'guiders/passwords', 12 registrations: 'guiders/registrations' 13 } 14 15 16 root 'home#index' 17 get 'home/index' 18 get '/search' => 'home#search' 19 20 resources :plans 21 resources :home 22 resources :guiders 23 resources :tourists 24 25 get "/plans/:id/category" => "plans#category" 26 get "/plans/:id/next" => "plans#next" 27 get "/plans/:id/tokyo" => "plans#tokyo" 28 get "/plans/:id/kyoto" => "plans#kyoto" 29 get "tourists/:id" => "tourists#show", as: :page 30 get "guiders/:id" => "guiders#edit", as: :mypage 31 get '/done' => 'tourists#done' 32 get 'tourists/:id' => 'tourists#show' 33 get 'guiders/:id/go' => 'guiders#go'
views/guiders/registration/new.html.erb
view
1<div class="contents center"> 2 3 <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> 4 <%= devise_error_messages! %> 5 6 <h2 class="ue">Sign up</h2> 7 8 <div class="field"> 9 <%= f.label :email %><br /> 10 <%= f.email_field :email %> 11 </div> 12 13 <div class="field"> 14 <%= f.label :password %> 15 <% if @validatable %> 16 <em>(<%= @minimum_password_length %> characters minimum)</em> 17 <% end %><br /> 18 <%= f.password_field :password, autocomplete: "off" %> 19 </div> 20 21 <div class="field"> 22 <%= f.label :password_confirmation %><br /> 23 <%= f.password_field :password_confirmation, autocomplete: "off" %> 24 </div> 25 26 <div class="field"> 27 <%= f.label :nickname %> <em>(6 characters maximum)</em><br /> 28 <%= f.text_field :nickname, autofocus: true, maxlength: "6" %> 29 </div> 30 31 <div class="actions"> 32 <%= f.submit "Sign up" %> 33 </div> 34 35 <div class="shita"> 36 <%= render "guiders/shared/links" %> 37 </div> 38 39 <% end %> 40</div>

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。