Mix.Tasks.Phoenix.Gen.Json

Mix.Tasks.Phoenix.Gen.Json

Generates a Phoenix resource.

mix phoenix.gen.json 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 schema in web/models
  • a view in web/views
  • a controller in web/controllers
  • a migration file for the repository
  • test files for generated model and controller

If you already have a model, the generated model can be skipped with --no-model. Read the documentation for phoenix.gen.model for more information on attributes and namespaced resources.

Summary

Functions

run(args)

Functions

run(args)

© 2014 Chris McCord
Licensed under the MIT License.
https://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Gen.Json.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部