Double Auth Engine
Authlogic and Declarative Authorization together in one fantastic Rails engine. Bladow!
Setup
Add double_auth_engine to Gemfile
gem "double_auth_engine"
Rebundle
bundle install
Run the DoubleAuthEngine install generator
rails g double_auth_engine:install
Migrate your DB and seed it with default seeds (:user and :admin)
rake db:migrate:seed
Update "[email protected]" 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) || "[email protected]" if input.nil? from_without_default(input) end alias_method_chain :from, :default end
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 AuthlogicAdd Password ResetChange PasswordUpdate generator with ActionMailer monkey patchUpdate install generator to add include to ApplicationControllerUpdate README for mailer settingsAuthlogic specsAdd Declarative AuthorizationDeclarative Authorization specsFriendly 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.
- Kyle Bolton - Creator
- Jeremy Durham
Copyright (c) 2011 Kyle Bolton, released under the MIT license