The Rails help message says:
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
I'm specifically interested in -p
to see what files would be generated. However, the following commands don't work:
rails generate -p migration CreateFoo foo:string
rails generate migration -p CreateFoo foo:string
How do I run a "pretend" generate command in Rails?
The -p
flag goes at the end of the command, eg:
rails generate migration CreateFoo foo:string -p