Hello, I'm... Carmelyne
I'm a web developer with strong information architecture skills & ability to design simple & engaging user interfaces.
August 21, 2007 by carmelyne (updated: 03/12/08)
============================
Update: [March 12, 2008] This blog post is outdated so if you found this page using google, I'd recommend reading something more up-to-date. Unfortunately, I don't know where else to refer you right now. I shared my thoughts and experience with the plugin at the time I was using it for a project. Living in the now, you can grab Obie Fernandez's Book " The Rails Way ". That comes highly recommended!
============================
Ryan showed us how to set up restful_authentication a plugin by Rick Olson with his 67th Railscasts Episode: restful_authentication . Pretty awesome! Now, we will extend it to the activation part.
./script/generate authenticated user sessions --include-activation
With the added --include-activation option, more files and codes will be generated to handle "Activation for a User who just registered".
Shall we break them down in steps... baby steps and with codes. I would be happy to do a screencast for this but I dont own a podcast mic yet so lets do it the old school way. I know we're all spoiled by Ryan's RailsCasts and Geoffrey's PeepCodes . We are the little Brats! :)
After generating the files for restful_authentication, follow the 67th episode set up plus these...
Step 1: All about Environment.rb
Open your environment.rb file and set up the following:
Note: Just a heads up -- if you're on SliceHost like I am, I can't get this to work on just Postfix on Ubuntu. I needed to set up the SMTP settings on the environment.rb file.
Step 2: All about app/models/user_notifier.rb
Now you can see how we set a dryer way to add the HOST via #{HOST}. The codes below is also an example if you've extended it to handle resetting the passwords. Although you will have to add an additional user migration for "password_reset_code" and adding it to your user model/controller codes and more to your routes....
Anyway, code snippets below:
Step 3: All about app/views/user_notifier/activation.rhtml
This gets sent out for the activation email so you can change the verbiage to something like this:
I think that should be it. :)
I wrote this up to give you an idea for activation. If you extended it way beyond for forgot_password/reset_password, make sure you extend your user model and controller to handle these additional functions. More snippets....
Extras
Update
But of course, there's a much better resource for the plugins, I was just referred to it after this long post from the man himself => Rick's Stikipad for Acts As Authenticated and RESTful authentication .
The additional methods for activation/forgot_password/reset_password does not fall under REST.
Tags: Playground, Ruby / Rails, Scripting / Snippets, Thoughts
——
Posted: September 27th, 2007 at 12:04 PM
Posted: September 27th, 2007 at 12:32 PM
Posted: September 27th, 2007 at 09:21 PM
Posted: September 28th, 2007 at 01:51 AM