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>
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>
相关文章推荐
- Creating Your Own Server: The Socket API, Part 1
- Creating Your Own Server: The Socket API, Part 2
- Creating Your Own Widgets using SWT
- Creating Your Own Procedures
- [zz]Creating Your Very Own Symbol Server
- [Google Android] Creating Your Own Spelling Checker Service
- How to Build Your Own Blockchain 1 Creating, Storing, Syncing, Displaying, Mining, and Proving Work
- Creating your own ODS Style Template for PDF Output
- Using JavaScript in PeopleSoft: Creating your own dialog boxes
- Creating Your Own Validation
- Creating your own auto-configuration
- Creating and Using Your Own Delegates in Objective-C
- Put Google Maps on Your Own Web Site——Google 地图 API 文档之三
- [zt] Creating your own GTK+ widget & adding it to Glade Palette
- PowerTip of the Day-Creating Your Own Types
- 建立根证书,颁发新的证书Creating Your Own SSL Certificate Authority (and Dumping Self Signed Certs)
- Creating your own JavaScript Library
- Creating your own SAP Customized Main Menu
- Creating Your Own Personalized Sewing Label
- Creating your own header file in C