devise
https://github.com/plataformatec/devise
Ruby
Flexible authentication solution for Rails with Warden.
Devise.add_module
Register available devise modules. For the standard modules that Devise provides, this method is called from lib/devise/modules.rb. Third-party modules need to be added explicitly using this method. Note that adding a module using this method does not cause it to be used in the authentication process. That requires that the module be listed in the arguments passed to the 'devise' method in the model class definition. == Options: +model+ - String representing the load path to a custom *model* for this module (to autoload.) +controller+ - Symbol representing the name of an existing or custom *controller* for this module. +route+ - Symbol representing the named *route* helper for this module. +strategy+ - Symbol representing if this module got a custom *strategy*. +insert_at+ - Integer representing the order in which this module's model will be included All values, except :model, accept also a boolean and will have the same name as the given module name. == Examples: Devise.add_module(:party_module) Devise.add_module(:party_module, strategy: true, controller: :sessions) Devise.add_module(:party_module, model: 'party_module/model') Devise.add_module(:party_module, insert_at: 0)
Edit
git clone [email protected]:plataformatec/devise.git
cd devise
open lib/devise.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Devise-add_module-for-pr
# Commit to gitgit add lib/devise.rbgit commit -m "better docs for Devise.add_module"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Devise-add_module-for-pr
hub pull-request
# Celebrate!