Creating Your Own Rails API Documentation

You can create your own local version of the consolidated Rails API docu-
mentation.Justtypethefollowingcommandsatacommandprompt(remem-
bering to start the command window in your Rails environment if you’re using
InstantRails or Locomotive):
rails_apps> rails dummy_app
rails_apps> cd dummy_app
dummy_app> rake rails:freeze:gems
dummy_app> rake doc:rails
The last step takes a while. When it finishes, you’ll have the Rails API documen-
tation in a directory tree starting at doc/api. We suggest moving this folder to
your desktop and then deleting the dummy_app tree.
To view the Rails API documentation, open the location doc/api/index.html with
your browser.

 

如果你想使用某一特定版本的RAILS来开发自己的WEB,请先参照我前一篇的内容,例如:rails _2.2.2_ --version

rails会从应用程序的文件夹中删除2.3.5的一些组件。并且你的应用程序会一直使用此版本,而不管机器上是否还有更高的版本。

 

F:/InstantRails/rails_apps/depot>ruby script/generate
Usage: script/generate generator [options] [args]

Rails Info:
    -v, --version                    Show the Rails version number and quit.
    -h, --help                       Show this help message and quit.

General Options:
    -p, --pretend                    Run but do not make any changes.
    -f, --force                      Overwrite files that already exist.
    -s, --skip                       Skip files that already exist.
    -q, --quiet                      Suppress normal output.
    -t, --backtrace                  Debugging: show backtrace on errors.
    -c, --svn                        Modify files with subversion. (Note: svn mu
st be in path)
    -g, --git                        Modify files with git. (Note: git must be i
n path)


Installed Generators
  Builtin: controller, helper, integration_test, mailer, metal, migration, model
, observer, performance_test, plugin, resource, scaffold, session_migration

More are available at http://wiki.rubyonrails.org/rails/pages/AvailableGenerators
  1. Download, for example, login_generator.zip
  2. Unzip to directory C:/Documents and Settings/Administrator/.rails/generators/login
     to use the generator with all your Rails apps
     or to F:/InstantRails/rails_apps/depot/lib/generators/login
     to use with this app only.
  3. Run generate with no arguments for usage information
       script/generate login

Generator gems are also available:
  1. gem search -r generator
  2. gem install login_generator
  3. script/generate login


F:/InstantRails/rails_apps/depot>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值