RESTful Authentication replaces the Acts as Authenticated plugin. Both plugins are by technoweenie, but he has stopped development on the latter.
script/plugin source http://svn.techno-weenie.net/projects/plugins
script/plugin install restful_authentication
./script/generate authenticated user sessions --include-activation
--include-activation so that users are emailed after activation.
Rails::Initializer.run do |config| block of config/environment.rbconfig.active_record.observers = :user_observer
# render new.rhtml
def new
# Store the referer so that we can go back to where the user wanted to log in.
referer = URI::parse(request.referer)
session[:return_to] = referer.path if referer.host == request.host
end