开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜