Rails 模型类型列表 [英] List of Rails Model Types
本文介绍了Rails 模型类型列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有人有生成模型脚手架时指定的模型类型的完整列表
Does someone have a complete list of model types that be specified when generating a model scaffolding
例如
foo:string
bar:text
baz:boolean
等等...
这些类型在默认 UI 元素方面映射到什么?文本字段、文本区域、单选按钮、复选框等...
And what do these types map to in terms of default UI elements? Text field, Text area, radio button, checkbox, etc...
推荐答案
属性为 SQL 类型,因此支持以下内容:
The attributes are SQL types, hence the following are supported:
:二进制
:boolean
:日期
:日期时间
:十进制
:float
:整数
:primary_key
:string
:text
:时间
:时间戳
这些记录在列下"noreferrer">Active Record API.
These are documented under column in the Active Record API.
这篇关于Rails 模型类型列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文