0

例如:

geddy gen scaffold person name:default

geddy gen scaffold person name

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

4

1 回答 1

0

来自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,将显示在列表中的属性将nameid.

于 2014-04-14T21:06:23.493 回答