tldr/pages/common/rails-generate.md

350 B

rails generate

Generate new Rails templates in an existing project.

  • List all available generators:

rails generate

  • Generate a new model:

rails generate model {{model_name}}

  • Generate a new controller:

rails generate controller {{controller_name}}

  • Generate a scaffold for a new model:

rails generate scaffold {{model_name}}