Mix.Tasks.Phoenix.Gen.Resource
Generates a Phoenix resource.
mix phoenix.gen.resource User users name:string age:integer
The first argument is the module name followed by its plural name (used for resources and schema).
The generated resource will contain:
- a model in web/models
- a view in web/views
- a controller in web/controllers
- a migration file for the repository
- default CRUD templates in web/templates
Namespaced resources
Resources can be namespaced, for such, it is just necessary to namespace the first argument of the generator:
mix phoenix.gen.resource Admin.User users name:string age:integer
Summary↑
| run(arg1) | Callback implementation of |
Functions
Callback implementation of Mix.Task.run/1.