-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
45 lines (31 loc) · 1.46 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
MinimalistAuthentication
========================
A Rails authentication plugin that takes a minimalist approach. It is designed to be simple to understand, use, and modify for your application.
This plugin was largely inspired by the restful-authentication plugin (http://github.com/technoweenie/restful-authentication/tree/master). I selected the essential methods for password based authentication, reorganized them, trimmed them down when possible, added a couple of features, and resisted the urge to start adding more.
Installation
============
git clone git://github.com/aaron/minimalist_authentication.git minimalist_authentication
ruby script/generate scaffold user active:boolean email:string crypted_password:string salt:string last_logged_in_at:datetime
Example
=======
app/models/user.rb
class User < ActiveRecord::Base
include Minimalist::Authentication
end
app/controllers/application.rb
class ApplicationController < ActionController::Base
include Minimalist::Authorization
# Lock down everything by default
# use skip_before_filter to open up sepecific actions
prepend_before_filter :authorization_required
end
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController
include Minimalist::Sessions
skip_before_filter :authorization_required, :only => [:new, :create]
end
test/test_helper.rb
class Test::Unit::TestCase
include Minimalist::TestHelper
end
Copyright (c) 2009 Aaron Baldwin, released under the MIT license