Learning rails is very easy these days with the wealth of amazing tutorials out there however in my search I couldn’t find a good tutorial on how to build an email confirmation system for user sign up (you know the type where you have to click on a link in an email to confirm that the email address is actually yours).

After spending some time figuring out I thought it would be good to share it so you don’t have to waste any time integrating this must have functionality.

It first authenticates, then it sets up the proper session values and cookies to persist the session.

authlogic account activation validating email-29

Verifying your email address with Steam improves the security of your Steam Account.

Once you've verified your email address with Steam, both your Steam Account password and access to your email account are required in order to make any changes to your Steam Account credentials, such as your password, secret question and answer, and contact email address.

First make the file controllers/mailers/user_and insert the following code: file but you can also include it inside of the method if you like.

In this file the and user.email variables refer to the name and email columns in the user table which you probably have already previously setup but perhaps with different naming conventions.

In order to do this use the generate command in the terminal inside your rails app root folder: to migrate the changes to the users model. There are a couple of ways to implement this and in this example I chose to keep all the actions inside the users controller .

For insights into the other option which would be to create a new controller specifically for the task of confirming a users email please see the railscasts episode on implementing password reset functionality to your rails app.

The point of this model is to handle all of the session details for you.

Just like Active Record handles all of the database details.

This also benefits other people in the future with the same questions / problems. == Authlogic "add ons" If you create one of your own, please let me know about it so I can add it to this list.