LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rails-generate

Scaffold Rails application components from templates

TLDR

Generate model
$ rails generate model [Name] [field:type]
copy
Generate controller
$ rails generate controller [Name] [action]
copy
Generate scaffold
$ rails generate scaffold [Name] [field:type]
copy
Generate migration
$ rails generate migration [Name]
copy

SYNOPSIS

rails generate generator name [options]

DESCRIPTION

rails generate creates boilerplate files from templates for common Rails application components. It scaffolds models with database migrations, controllers with associated views and routes, and full CRUD interfaces through the scaffold generator, following Rails naming conventions and directory structure automatically.Each generator produces the appropriate set of files including source code, test stubs, and configuration entries. The --pretend flag previews what would be created without writing files, and --skip-routes prevents automatic route additions. Custom generators can be created to match project-specific patterns, and the inverse operation rails destroy removes all files a generator created.

PARAMETERS

model name

Generate model.
controller name
Generate controller.
scaffold name
Generate full CRUD.
migration name
Generate migration.
-p, --pretend
Preview without creating.
--skip-routes
Don't add routes.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid