Topic: Acts_as_Authenticated User/Login Gem

Acts_as_authenticated is a simple plugin that allows you to create users, and to allow or permit access to different controllers and actions based on if users are logged in (and if so, who they are).  It's relatively simple, but straight-forward, and handles all the nitty-gritty details for you (like encryption and salting).  Best of all, the gem comes with all the right actions and forms, so once it's installed, you can create a new user and start authenticating in minutes.

Here's a link to the official StikPad page: http://wiki.rubyonrails.org/rails/pages … henticated

To use this gem, you need to do the following:

1) Install the gem by typing: script/plugin install http://svn.techno-weenie.net/projects/p … henticated

2) Generate the user and account models by typing: script/generate authenticated user account

3) Rake the DB to add the users table with: rake db:migrate

4) Add this line to application.rb so you can use the gem: include AuthenticatedSystem

You can block access in your controllers with: before_filter :login_required.  (You can also specify which filters to allow using :except, and passing a list of actions to permit.)

Again, this gem comes with the actions to create and edit users, and to log in and log out.

You can find more details in this article here: http://www.railsrocket.com/articles/act … ted-plugin

Last edited by ashes999 (2008-06-21 22:14:02)

Check out RailsRocket, a Ruby on Rails community website, or the eBook on internationalizing your Rails app in 34 languages.

Re: Acts_as_Authenticated User/Login Gem

1) This is not a gem, but a plugin

2) this was replaced by the RESTful_authentication plugin from the same author some time ago already wink

Re: Acts_as_Authenticated User/Login Gem

Wow, I'm seriously out of date smile thanks for letting me know!

Check out RailsRocket, a Ruby on Rails community website, or the eBook on internationalizing your Rails app in 34 languages.