Archive

Archive for January 10th, 2009

restful authentication rails

January 10th, 2009 mahesh No comments

I just followed the screencast for restful authentication and it is really straightforward. Even though it is for rails 1.x, it works for 2.x since the plugin is updated. The only problem I had was when I tried signin, it was giving me “uninitialized constant SessionController” error.  I had to change my  routes.rb file to add the controller name like below:

map.resource :session, :controller => 'session'

rails by deafult assumes that the controller is sessions (plural) but I had to force it to be singular.

It works like a charm now! I am going to tweak it fit my application now.

In the process, I also learnt to add plugin repositories to your application so that it is easy to pull in plugins. Here is an example.

script/plugin source http://svn.techno-weenie.net/projects/plugins
script/plugin install restful_authentication

Categories: Uncategorized Tags: