Authentication with Restful_Authentication in 3rdRail
There is a plethora of authentication mechanisms in the Rails world. One of the more popular one is Restful_Authentication. Just how do you set up Restful_Authentication for use in 3rdRail to provide some basic authentication mechanism?
http://railscasts.com/episodes/67 has some instructions on how you can set this up for use. However, while following the instructions on that site, please take note of the following points below.
I’ve attached my sample project for reference. test_194.zip
Things to note:
1. routes.rb needs to be changed as mentioned in the railscast site. However, additional entry may need to be added. The railscast side uses / as the root directory, I use /home
2. Create your own Home controller and index.rhtml
3. You may need to refactor your Session controller generated by the script to Sessions controller.
4. Changes have been made to the Users and Sessions sessions controllers as well as index.rhtml. I have thrown the user logged in status into session as well as the user name. These are used to determine whether the user is logged in and to greet the user in index.rhtml
5. I used interbase. If you use mysql, you may need a different database.yml and to create the tables yourself.
This should enable you to use restful_authentication to do simple authentication.
Share This | Email this page to a friend
Posted by Wei Keong Ho on December 12th, 2007 under Uncategorized |

RSS Feed

Leave a Comment