Techie August 2022
1 . Redirecting User After Sign Up (Confirmation Pending)
If you want to redirect the user to a specific url after signing up, override the after_inactive_sign_up_path_for in the registrations_controller.
i). Create a new registrations_controller.rb in app/controllers directory.
ii). Override Devise default behaviour in the routes in config/routes.rb
2 . Redirecting User From The Confirmation Email
You may want to redirect the user to a specific url after they clicked the link in the confirmation email. To do that, just override the after_confirmation_path_for in the confirmations_controller.
i). Create a new confirmations_controller.rb in app/controllers directory.
ii). Override Devise default behaviour in the routes in config/routes.rb
3 . Update User email without Sending a Confirmation Email
If you are using the :reconfirmable attribute and want
to update a user’s email without needing a confirmation email to be sent, you can
use the skip_reconfirmation! like so:
4 . Allowing Unconfirmed Users For A Given Period
You can give unconfirmed users some time to confirm their emails by setting the period for allow_unconfirmed_access_for in the config/initializers/devise.rb file.
5 . Skip Required Confirmation
You can skip required confirmation even if you’ve already added confirmable for devise.
6 . Allow Users to Login and Confirm their Emails Later
i). Enable reconfirmable and set allow_unconfirmed_access_for in config/initializers/devise.rb file.
ii). Create the column in the users table.
iii). Send users confirmation email like so:
Thanks for reading, see you in the next one!