I have a User.create action that provisionally registers a new user and sends an email with a generated password. What is the most Rails-like way to complete that action? I want to do everything exactly right from now on. No more nonsense. This time I’m serious.
I’m thinking these are the options…
-
Create a view called
login_email_sent.html.hamland render it. (It would have a message like ‘thanks, an email has been sent with your login.’) -
Create a view called
create.html.hamland let Rails render that by default. -
Redirect the user to the same page as the form they just submitted with a message in the flash.
Or something else…?
This is more of a user experience question.
Leave the create action as something that just creates and has no output (or just a simple
201 Createdheader if created by an API call). Do aredirect_toto either:In 99.9% of cases you shouldn’t ever need a template for create.
For instance.