Divert

This project rocks and uses MIT-LICENSE.

Currently, in order to use:

gem 'divert'

Install the migrations with

rake divert:install:migrations
rake db:migrate

Then add:

divert_with :controller_name

to the END of your routes file. The route added catches anything so needs to go last.

Finally add:

include Divert

to the controller specified in the above route.

It will not interfere with actions defined in that controller or view files that don’t have an action defined. Cos it’s nice like that.

By default, Divert will hit the database to find or create a record. To turn off this behaviour, add this following configuration code in your ‘config/initializers/divert.rb` :

Divert.configure do |config|
  config.save_to_db = false
end