列出rails应用程序中的可用生成器

时间:2013-09-02 07:26:18

标签: ruby-on-rails

如何在generators应用中获取可用Rails的列表,包括来自devise等内容的宝石? (类似于rake -T列表rake tasks

1 个答案:

答案 0 :(得分:27)

我明白了。命令是

rails generate

输出是这样的:

Usage: rails generate GENERATOR [args] [options]
General options:
  -h, [--help]     # Print generator's options and usage
  -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 status output

Please choose a generator below.

Rails:
  assets
  controller
  generator
  helper
  inherited_resources_controller
  integration_test
  mailer
  migration
  model
  observer
  performance_test
  resource
  responders_controller
  scaffold
  scaffold_controller
  session_migration
  task

ActiveRecord:
  active_record:devise
  active_record:migration
  active_record:model
  active_record:observer
  active_record:session_migration

Coffee:
  coffee:assets

Devise:
  devise
  devise:install
  devise:views