Note that there are some explanatory texts on larger screens.

plurals
  1. POHow-to: Devise after_sign_up_redirect?
    primarykey
    data
    text
    <p>I tried to follow the instructions here (<a href="https://github.com/plataformatec/devise/wiki/" rel="nofollow">GitHub Devise Wiki</a>) but it's not working for me.</p> <p>I'm trying to get Devise to redirect to /welcome after user signs up. I created a <strong>Registrations</strong> controller but it's never going into the view. What am I doing wrong here?</p> <p>Ruby 1.9.2 Rails 3.1.0.rc4 Devise 1.4.2</p> <p>Thank you</p> <p><strong>UPDATE:</strong></p> <p>For some reason <strong>after_sign_up_path_for</strong> is not triggered but <strong>after_sign_in_path_for</strong> is triggered. I would still like to get <strong>after_sign_up_path_for</strong> to work though</p> <p>_app/controllers/registrations_controller.rb_</p> <pre><code>class RegistrationsController &lt; Devise::RegistrationsController protected def after_sign_up_path_for(resource) welcome_path end end </code></pre> <p>Here's my <em>config/routs.rb</em></p> <pre><code>MyApp::Application.routes.draw do devise_for :users root :to =&gt; 'pages#home' match "/users", :to =&gt; "users#all" match "/users/:id", :to =&gt; "users#show", :as =&gt; :user match "/welcome", :to =&gt; "users#welcome", :as =&gt; :user devise_for :users, :controllers =&gt; { :registrations =&gt; "registrations" } do get "/login", :to =&gt; "devise/sessions#new" get "/register", :to =&gt; "devise/registrations#new" get "/logout", :to =&gt; "devise/sessions#destroy" get '/account' =&gt; 'devise/registrations#edit' end end </code></pre> <p>Output from <em>rake routes</em></p> <pre><code>new_user_session GET /users/sign_in(.:format) {:action=&gt;"new", :controller=&gt;"devise/sessions"} user_session POST /users/sign_in(.:format) {:action=&gt;"create", :controller=&gt;"devise/sessions"} destroy_user_session DELETE /users/sign_out(.:format) {:action=&gt;"destroy", :controller=&gt;"devise/sessions"} user_omniauth_callback /users/auth/:action/callback(.:format) {:action=&gt;/(?!)/, :controller=&gt;"devise/omniauth_callbacks"} user_password POST /users/password(.:format) {:action=&gt;"create", :controller=&gt;"devise/passwords"} new_user_password GET /users/password/new(.:format) {:action=&gt;"new", :controller=&gt;"devise/passwords"} edit_user_password GET /users/password/edit(.:format) {:action=&gt;"edit", :controller=&gt;"devise/passwords"} PUT /users/password(.:format) {:action=&gt;"update", :controller=&gt;"devise/passwords"} cancel_user_registration GET /users/cancel(.:format) {:action=&gt;"cancel", :controller=&gt;"devise/registrations"} user_registration POST /users(.:format) {:action=&gt;"create", :controller=&gt;"devise/registrations"} new_user_registration GET /users/sign_up(.:format) {:action=&gt;"new", :controller=&gt;"devise/registrations"} edit_user_registration GET /users/edit(.:format) {:action=&gt;"edit", :controller=&gt;"devise/registrations"} PUT /users(.:format) {:action=&gt;"update", :controller=&gt;"devise/registrations"} DELETE /users(.:format) {:action=&gt;"destroy", :controller=&gt;"devise/registrations"} root / {:controller=&gt;"pages", :action=&gt;"home"} users /users(.:format) {:controller=&gt;"users", :action=&gt;"all"} user /users/:id(.:format) {:controller=&gt;"users", :action=&gt;"show"} user /welcome(.:format) {:controller=&gt;"users", :action=&gt;"welcome"} login GET /login(.:format) {:controller=&gt;"devise/sessions", :action=&gt;"new"} register GET /register(.:format) {:controller=&gt;"devise/registrations", :action=&gt;"new"} logout GET /logout(.:format) {:controller=&gt;"devise/sessions", :action=&gt;"destroy"} account GET /account(.:format) {:controller=&gt;"devise/registrations", :action=&gt;"edit"} new_user_session GET /users/sign_in(.:format) {:action=&gt;"new", :controller=&gt;"devise/sessions"} POST /users/sign_in(.:format) {:action=&gt;"create", :controller=&gt;"devise/sessions"} destroy_user_session DELETE /users/sign_out(.:format) {:action=&gt;"destroy", :controller=&gt;"devise/sessions"} user_omniauth_callback /users/auth/:action/callback(.:format) {:action=&gt;/(?!)/, :controller=&gt;"devise/omniauth_callbacks"} POST /users/password(.:format) {:action=&gt;"create", :controller=&gt;"devise/passwords"} GET /users/password/new(.:format) {:action=&gt;"new", :controller=&gt;"devise/passwords"} GET /users/password/edit(.:format) {:action=&gt;"edit", :controller=&gt;"devise/passwords"} PUT /users/password(.:format) {:action=&gt;"update", :controller=&gt;"devise/passwords"} GET /users/cancel(.:format) {:action=&gt;"cancel", :controller=&gt;"registrations"} POST /users(.:format) {:action=&gt;"create", :controller=&gt;"registrations"} GET /users/sign_up(.:format) {:action=&gt;"new", :controller=&gt;"registrations"} GET /users/edit(.:format) {:action=&gt;"edit", :controller=&gt;"registrations"} PUT /users(.:format) {:action=&gt;"update", :controller=&gt;"registrations"} DELETE /users(.:format) {:action=&gt;"destroy", :controller=&gt;"registrations"} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload