当您在 Rails 中创建模型时,您可以这样操作:
美元rails g scaffold ModelName attributeName1:type attributeName2:type attributeName3:type
...
有没有办法从 generation 语句中声明默认值,或者你必须在迁移之前在迁移文件中这样做?
当您在 Rails 中创建模型时,您可以这样操作:
美元rails g scaffold ModelName attributeName1:type attributeName2:type attributeName3:type
...
有没有办法从 generation 语句中声明默认值,或者你必须在迁移之前在迁移文件中这样做?