将模板传递给“rails new" [英] Passing template to "rails new"

查看:65
本文介绍了将模板传递给“rails new"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当调用rails new"时,显然可以通过-m"命令行参数传递某种模板或设置脚本.我通过 https://github.com/fortuity/rails3 找到了这个-mongoid-devise/wiki/教程-(演练).和 https://github.com/fortuity/rails3-application-templates/blob/master/rails3-mongoid-devise-template.rb 看起来像用于操作 Rails 应用程序的 DSL.这看起来很酷,但我无法找到有关它的更多信息.有人能给我指点相关文档吗?

When calling "rails new" it is obviously possible to pass some kind of template or setup script via the "-m" command line parameter. I found this via https://github.com/fortuity/rails3-mongoid-devise/wiki/Tutorial-(Walkthrough). And https://github.com/fortuity/rails3-application-templates/blob/master/rails3-mongoid-devise-template.rb looks like DSL for manipulating Rails applications. That looks quite cool, but I was not able to find more information about it. Could somebody point me to the related documentation?

推荐答案

以下是一些您可能会觉得有用的信息:

Here is some information you may find useful:

  • Rails templates (a high-level overview)
  • Templates in Rails 3 (lists some of the commands and links to documentation)
  • RDoc for Thor::Actions
  • Source for Rails specific actions

我还在 Rails 源代码中找到了 本指南主要指南页面,但可能有一些对您有用的信息.

I also found this guide in the Rails source code which isn't linked to from the main Guides page, but may have some useful information for you.

您可能还对 默认应用模板方法的来源,当您使用 rails new 且不带 -m 选项或 这个应用程序模板 我刚开始探索一些不同的选项.

You may also be interested in the source for the default app template methods, which is used when you use rails new with no -m option, or this application template I started on a while back that explores some different options.

这篇关于将模板传递给“rails new"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆