【问题标题】:Phoenix unable to generate html template with error "invalid module name"Phoenix 无法生成带有错误“无效模块名称”的 html 模板
【发布时间】:2019-05-05 07:39:01
【问题描述】:

运行 phx.gen.html 模板时遇到问题。这是我正在尝试的命令


mix phx.gen.html Shipments shipmentroutes shipmentroute address:string date:string groups_involved:string

带有此错误消息


mix phx.gen.html, phx.gen.json and phx.gen.context expect a
context module name, followed by singular and plural names of
the generated resource, ending with any number of attributes.
For example:

    mix phx.gen.html Accounts User users name:string
    mix phx.gen.json Accounts User users name:string
    mix phx.gen.context Accounts User users name:string

The context serves as the API boundary for the given resource.
Multiple resources may belong to a context and a resource may be
split over distinct contexts (such as Accounts.User and Payments.User).

它没有说明为什么它不是有效的模块名称,所以我不知道如何解决这个问题。我在网上没有看到类似的东西。知道为什么 phoenix 认为这是一个错误的模块名称吗?

【问题讨论】:

    标签: html generator phoenix-framework


    【解决方案1】:

    对于遇到这种情况的任何人,phoenix 允许任何以大写字母开头的架构,所以它应该看起来像这样

    mix phx.gen.html Shipments Shipmentroutes shipmentroute address:string date:string groups_involved:string
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-27
      • 1970-01-01
      • 1970-01-01
      • 2018-03-12
      相关资源
      最近更新 更多