Generate
The generators in maze are a great way to get an application up and running quickly. In addition, they help keep code consistent and following convention.
Example Usage
You can always see the available generators by running maze generate as below:
$ maze generate
Parsing Error: The TYPE argument is required.
maze generate [OPTIONS] TYPE NAME [FIELDS1 FIELDS2...]
Arguments:
FIELDS (multiple) user:reference name:string body:text age:integer published:bool
NAME name of resource
TYPE scaffold, model, controller, migration, mailer, socket, channel, auth
Options:
--no-color Disable colored outputGenerators can be used multi-word names, the class names will be CamelCase and file names will be snake_case, the command line input can be either:
$ maze generate [TYPE] MultiWordName [FIELD1 FIELD2 ...]
# OR
$ maze generate [TYPE] multi_word_name [FIELD1 FIELD2 ...]See Scaffolding below for full example.
Examples of Usage
Scaffolding
Scaffolding will create the model (and specs), views, controller (and specs) and migrations for a resource. Additionally, it will add the new resource to the nav bar and
If you scaffold a multi-word resource, the class names will be CamelCase and file names will be snake_case, the command line input can be either:
Auth
Model
Controller
Recipes
Recipes are available to generate Scaffolding, Controller and Model artifacts in ways that vary from the standard built in generator. See the Recipes option of the Command Line Tool for more information about using recipes to generate applications.
Last updated