Full Stack LAMP - MEAN Developer, Python developer. Certified Azure Developer. Freelance programmer/consultant/trainer.

ROR – How to update the email of the user when using devise gem?

If you update the user email address when you are using the device gem, it will be stored in the unconfirmed_email column and it will trigger an email, by asking for confirmation with a confirmation link. If you want to override this behavior you can do that, by calling skip_reconfirmation!.

To skip only the reconfirmation email notification use: skip_confirmation_notification!

To confirm the user manually you can use: confirm.

Example Script

         user = ser.where(:email => params[:email]).first
         user.email = params[:email];
         user.first_name = params[:first_name];
         user.last_name = params[:last_name];
         user.country_code = params[:country_code];
         user.phone_number = params[:phone_number];
         user.date_of_birth = params[:date_of_birth];
         user.skip_reconfirmation!
         user.save

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Subscribe
Notify of
guest

1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments