Examples (5)
List all available generators
Generate a new model named Post with attributes title and body
rails generate model Post title:string body:textGenerate a new controller named Posts with actions index, show, new, and create
rails generate controller Posts index show new createGenerate a new migration that adds a category attribute to an existing model called Post
rails generate migration AddCategoryToPost category:stringGenerate a scaffold for a model named Post, predefining the attributes title and body
rails generate scaffold Post title:string body:textmade by @shridhargupta | data from tldr-pages