Created
March 5, 2012 18:34
-
-
Save rodrigomaia/1980204 to your computer and use it in GitHub Desktop.
Loading rake task and generators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Loading rake tasks and generators | |
| If your railtie has rake tasks, you can tell Rails to load them through the method ::rake_tasks: | |
| class MyRailtie < Rails::Railtie | |
| rake_tasks do | |
| load "path/to/my_railtie.tasks" | |
| end | |
| end | |
| By default, Rails load generators from your load path. However, if you want to place your generators at a different location, you can specify in your Railtie a block which will load them during normal generators lookup: | |
| class MyRailtie < Rails::Railtie | |
| generators do | |
| require "path/to/my_railtie_generator" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment