【问题标题】:When scaffolding in Geddy, what is the difference between a data-type "default" and not putting a data type?在 Geddy 中搭建脚手架时,数据类型“默认”和不放置数据类型有什么区别?
【发布时间】:2014-03-19 21:57:35
【问题描述】:

例如:

geddy gen scaffold person name:default

geddy gen scaffold person name

两者都创建了一个数据类型为“字符串”的属性“名称”。这两种语法有什么区别吗?

【问题讨论】:

    标签: geddy


    【解决方案1】:

    来自Geddy 文档:

    $ geddy gen scaffold user name:default This example creates scaffolding but includes name as the default property that will be used when displaying the content in the views.

    In this example the property name is given the type string because no type was given. You could have also written name:string:default (or some other type in place of 'string'). If no default property is given Geddy will use id as the default display property.

    当您提供的属性没有Geddy 类型时,将假定其类型为string

    另一方面,default 告诉Geddy 使用该属性而不是id 属性作为默认显示属性。

    例如:如果您执行$ geddy gen scaffold user name:default Geddy 将生成属性name 作为字符串,并且在您创建index.html 后在user 中将显示在列表中的属性将是name 而不是 id

    【讨论】:

      猜你喜欢
      • 2019-12-16
      • 1970-01-01
      • 2011-07-07
      • 1970-01-01
      • 1970-01-01
      • 2016-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多