Available commands: cell
, contract
, finder
and operation
Concept name and class name are required and validated before going ahead with the generation.
Examples:
bin/trailblazer g operation post create
-> will return an class_name errorbin/trailblazer g operation Post Create
-> will create the fileapp/concepts/post/operation/create.rb
using thecreate
templatebin/trailblazer g operation Post YeahNah
-> will create the fileapp/concepts/post/operation/yeah_nah.rb
using thegeneric
template and showing a Notice message saying that template yeah_nah template is not found and a generic one is used
The cell
and cells
commands will create also the corrispective view file unless option --view is set to none
.
Examples:
bin/trailblazer g cell Post New
-> will create 2 filesapp/concepts/post/cell/new.rb
andapp/concepts/post/view/new.slim
bin/trailblazer g cell Post New --view=none
-> will create 1 file onlyapp/concepts/post/cell/new.rb
Available commands: concept
, cells
and operations
Concept name is required and default arrays are used to generate the files
Example:
bin/trailblazer g operation Post
-> will generateindex.rb
,create.rb
,show.rb
andupdate.rb
inapp/concepts/post/operation
plural
and singular
(default one) are the possible options
Examples:
bin/trailblazer g operation Post Create --layout="singular"
-> will create the fileapp/concepts/post/operation/create.rb
(which is the default)bin/trailblazer g operation Post Create --layout="plural"
-> will create the fileapp/concepts/post/operations/create.rb
allows to use a specific existing template
Examples:
bin/trailblazer g operation Post Create --actiom=index
-> will create the fileapp/concepts/post/operation/create.rb
user theindex
template
If template is not found a Notice message saying that template yeah_nah template is not found and a generic one is used
allows to pass a custom folder as source where the template will be searched into
Requirements:
erb
file- expected stubs folder to have cell, contract, operation, view structure
allows to generate the view file with a template engine other than the default erb
, when passing --view=none
the view file will not be created
Examples:
bin/trailblazer g cell Post Create --view=erb
-> will create 2 filesapp/concepts/post/cell/create.rb
andapp/concepts/post/view/create.slim
allows to specify a different destination folder for the generating file (available in all commands)
bin/trailblazer g operation Post Create --path=custom_path
-> will create 1 filecustom_path/post/operation/create.rb
generates code TODO: more info and example for this
This is a work in progress.
The main idea we want with generator in the end, is that it also generates what's inside your files for the most basic aspects, think of validations, etc.