Usage: rails generate GENERATOR_NAME [args] [options]
.
Use rails generate
to list available generators. Alias: rails g
.
Parameter | Details |
---|---|
-h /--help | Get help on any generator command |
-p /--pretend | Pretend Mode: Run generator but will not create or change any files |
field:type | 'field-name' is the name of the column to be created and 'type' is the data-type of column. The possible values for 'type' in field:type are given in the Remarks section. |
The possible values for 'type' in field:type
are:
Data Type | Description |
---|---|
:string | For smaller pieces of text (usually has a character limit of 255) |
:text | For longer pieces of text, like a paragraph |
:binary | Storing data including images, audios and videos |
:boolean | Storing true or false values |
:date | Only the date |
:time | Only the time |
:datetime | Date and time |
:float | Storing floats without precision |
:decimal | Storing floats with precision |
:integer | Storing whole numbers |