Reputation: 69767
I am running
ruby script/generate scaffold
or
ruby script/generate model
and I know the basic syntax, like
ruby script/generate scaffold Dude name:string face:boolean
but I do not know things like:
Where can I find such information?
Upvotes: 21
Views: 23038
Reputation: 18270
This document on Rails Migration would help.
With respect to the naming convention, I think the general adopted convention for Ruby on Rails is to have underscores.
To know which variable types are acceptable, refer to the section on Database Mapping.
Upvotes: 10
Reputation: 143
There is a resource on the rails wiki as a List of Available Generators.
Upvotes: 6
Reputation: 19249
Type the command without arguments and the documentation is revealed:
$ script/generate model
You can use either camelcase or underscores for the model name.
I can't remember all the possible field types, I just look them up from the Migration docs, as linked above.
Upvotes: 27
Reputation: 1837
To check Rails naming conventions, topfunky's Pluralizer was useful.
Upvotes: 3