Dienstag, 20. Mai 2008

install plugin restfull_authentication

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

script/generate authenticated user sessions

To use:

./script/generate authenticated user sessions --include-activation

The first parameter specifies the model that gets created in signup(typically a user or account model). A model with migration is created, as well as a basic controller with the create method.

The second parameter specifies the sessions controller name. This is the controller that handles the actual login/logout function on the
site.

The third parameter (--include-activation) generates the code for a ActionMailer and its respective Activation Code through email.

You can pass --skip-migration to skip the user migration.

Also, add an observer to config/environment.rb if you chose the --include-activation option

config.active_record.observers = :user_observer # or whatever you named your model

Keine Kommentare: