User confirmation

Hi all,

In my application I currently have the ability to create a user which then begins a session and sends an email confirmation to the email address. Whilst this is all good I wish to make it a little more advanced.

What I wish to do is to have the ability of created the user and then the email gets sent that requires the user to verify through the email. Once they click confirm in the email the user is then registered to the database and then is able to log in.

How would I go about doing so?

If my current code is needed then I can provide.

Thanks.

Have you looked at the Devise gem? If not, I'd suggest creating a new project and getting familiar with it. You might decide that it handles all your authentication needs and you don't need to write anything.

Hey I have took a look at devise but most of my authentication has now been done through actual code rather than relying on gems. I was hoping for a non gem option as it is also a lot more beneficial in the sense of experience and getting to know rails.

Any ideas of what would be possible. I have looked at the rails cast for reset password. I just need to look at authentication for confirming user creation by clicking on a link in an email. I heard something about a confirmed column in the database?

I would second Paulie’s suggestion that you use Devise. However if you are still looking to do it yourself, I would suggest that you at least look at the “confirmable” model in the Devise source. It will help you understand the approach the Devise team took to solve this problem. You can find it here: https://github.com/plataformatec/devise/blob/master/lib/devise/models/confirmable.rb

This should help you see the big picture and then you can slim it down to just the functionality you feel is necessary for your app. This is one of the great advantages to open source!