Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Authlogic and Declarative Authorization Engine

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 double_auth_engine.gemspec
README.md

Double Auth Engine

Authlogic and Declarative Authorization together in one fantastic Rails engine. Bladow!

Setup

  1. Add double_auth_engine to Gemfile

    gem "double_auth_engine"
    
  2. Rebundle

    bundle install
    
  3. Run the DoubleAuthEngine install generator

    rails g double_auth_engine:install
    
  4. Migrate your DB and seed it with default seeds (:user and :admin)

    rake db:migrate:seed
    
  5. Update "default@dummy.com" within setup_mail.rb to the default address for your application. This address is used for the engine's password reset mailer.

    class ActionMailer::Base
      def from_with_default(input=nil)
        return from_without_default(input) || "default@dummy.com" if input.nil?
        from_without_default(input)
      end
      alias_method_chain :from, :default
    end
    
  6. Start app

    rails s
    

Usage

Anything within a Rails engine can be overridden by creating the same file within the parent application. For example if you'd like to create your own login form, simply create a new.html.erb within the app/views/user_sessions folder in your application. If you need to add additional functionality to one of the models or controllers provided by the engine, create the corresponding file in the appropriate place with your application and then include the associated module from the engine.

class User < ActiveRecord::Base
  include DoubleAuthEngine::UserMixin
end

Readme Driven Development

A strike means its done!

  • Add Authlogic
  • Add Password Reset
  • Change Password
  • Update generator with ActionMailer monkey patch
  • Update install generator to add include to ApplicationController
  • Update README for mailer settings
  • Authlogic specs
  • Add Declarative Authorization
  • Declarative Authorization specs
  • Friendly ID
  • Mailer specs
  • Style views

Versioning

This project uses Semantic Versioning

Contributors

All contributions are welcome. Fork repo, make changes, add specs, ensure all specs pass, send a pull request.

Copyright (c) 2011 Kyle Bolton, released under the MIT license

Something went wrong with that request. Please try again.