i intend to allow the user click on the link sent to their email address after registration to have their account activated. How do i implement this? Thank You
3 Answers
You can use the Devise gem to get this functionality for free: https://github.com/plataformatec/devise. See the confirmable feature: "Confirmable: sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in".
If you want to roll your own solution you should read the accepted answer to this question: Email confirmation in Rails without using any existing authentication gems/plugins.
There are two ways to do this:
recode the whole stuff yourself, basically: generate a token, link it to the user's account, add a link in the mail with the token
or use the builtin
confirmable
functionality in Devise: https://github.com/plataformatec/devise
I'd head towards the second option

- 114,565
- 26
- 219
- 213
-
Thanks once again, both options were relatively easy and worked well! – dev Jun 26 '11 at 21:33
All this has be acopmlished by the use of a simple gem called devise. Just run gem install devise to install the devise gem and read the read me to checkout the cool features.

- 4,059
- 6
- 40
- 73
-
What's the added value of your answer? 2 answers already suggest this – apneadiving Jun 26 '11 at 20:50