Generate | pods |
---|---|
g | --pod |
Just pass --pod
to ember generate
when generating new files.
If you would like to use the pods structure as the default for your project, you can set usePods in your .ember-cli
config file to true (setting was previously named usePodsByDefault
). To generate or destroy a blueprint in the classic type structure while usePods
is true
, use the --classic
flag.
With the usePods set to true.
// .ember-cli
{
"usePods": true
}
The following would occur when generating a route:
ember generate route taco
installing
create app/taco/route.js
create app/taco/template.hbs
installing
create tests/unit/taco/route-test.js
ember generate route taco --classic
installing
create app/routes/taco.js
create app/templates/taco.hbs
installing
create tests/unit/routes/taco-test.js
There are some benefits to use this method, however, it's completely up to you.Firstly, it separates your application into more logical groupings, thus, you can keep your files neatly organized into resources.
This structure also makes our development's life easier. For instance, if I want to find the myname
controller
in the default structure, I need to preface what I actually want (myname) with the type (controllers). However, with pods, I can fuzzy-find the same controller by simply looking up “myname.”