简体   繁体   中英

How to set up page template to redirect to it after Devise sign up?

After sign up I want to redirect to a custom page with something like:

signed.html.erb

"Thank you we have sent you an email..."

I followed the examples on the official documentation: How To: Redirect to a specific page on successful sign up (registration)

In all the documentation I have found this seems obvious but,

where do I place this template?

Do I have to create a custom route for this?

  1. Place the page wherever you want; wherever it makes the most sense in your application. (It could be a method and view associated with the new registrations controller you need to create, but it doesn't have to be)

  2. Yes, you'll need a route for it - just as you would with any other page.

In terms of the page you're redirecting to, there's nothing special about it, and it's not tied to Devise in any way at all. It's just like any other page in your application (in fact, it could well be any other page in your application).

So, make that page first. Put it where it makes the most sense, create a route for it, and make sure you can view it in your browser. Then, as a final step, just make Devise redirect to that route using the instructions you linked to above.

The instructions you linked to are purely for 'redirecting to another url after signup', and not for 'creating the page that you redirect to'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM