where to put custom install, e.g. rails g myapp:install
I've seen people use this to install apps:
rails g someapp:inst开发者_运维问答all
This is a custom generation correct? Where is the code to :install usually put or have to be put?
I think you would write a rake task, usually located in lib/tasks/
; the filename would look like this: someapp_install.rake
And its contents like this:
namespace :someapp do
desc "This installs my awesome app"
task :install => :environment do
# Code that does install stuff goes here...
end
end
精彩评论