A Rails::Railtie (pronounced “Rails Rail-tie”) allows you to hook into Rails’s initialization and configure some defaults. Such tools allow frameworks like Active Record to tell Rails how it should be initialized and configured by providing a railtie.
You should include a railtie in your plug-in only if at least one of the following is true:
Your plug-in needs to perform a given task while or after the Rails application is initialized.
Your plug-in needs to change a configuration value—for instance, setting a generator.
Your plug-in must provide Rake tasks and generators in nondefault locations (the default location for the former is lib/tasks, and it’s lib/generators or lib/rails/generators for the latter).