RailsGrunt

a noob working the ruby railroad.

login system for rails

February 23rd, 2007

if you are looking for login system for your rails application, the grunt feels that acts_as_authenticated is the way to go. for more information check it out here . After following the directions on the link, you wil notice that an account folder is created in your controller directory. In there, you can place any actions for the user account section of your site. The actions you want protected is easily done just by doing this in the beginning of the account controller file

before_filter :login_required, :only => [ :user, :something, :etc ]

Now when someone tries to access a view in the admin controller, they will be redirected to the login view or given the option to sign up. Isn’t that easy?