Acts as Authenticated plugin

Plugin details

This is a basic authentication generator for rails, very much in the spirit of xal's original Login Generator. This generates a basic user model, a controller, some basic views, and tests. Extra functionality can be unlocked by removing the comments for them.

Websitehttp://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated Repositoryhttp://svn.techno-weenie.net/projects/plugins/acts_as_authenticated/ Author Rick Olson Tags ActsAsAuthenticated, UserManagement, Login LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/acts_as_authenticated/

Generate the required code and migrations

ruby script/generate authenticated user account
ruby script/generate authenticated_migration



You can move the

include AuthenticatedSystem



from app/controllers/account_controller.rb to app/controllers/application.rb.
This makes all the authentication methods available to all controllers.

To require logins for all actions, use this in your controllers:

before_filter :login_required



To require logins for specific actions, use this in your controllers:

before_filter :login_required, :only => [ :edit, :update ]



To skip this in a subclassed controller:

skip_before_filter :login_required



Here are other available methods for your views and controllers:

logged_in?

– Returns true if the user is currently logged in.

current_user

– Returns an instance of the currently logged in user.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 9 months ago