您的位置:首页 > 大数据 > 人工智能

Creating Your Own Rails API Documentation

2010-01-18 14:09 465 查看
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>

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息