Ruby on Rails generates model field:type - what are the options for field:type?

后端 未结 8 1825
遥遥无期
遥遥无期 2020-12-22 15:42

I\'m trying to generate a new model and forget the syntax for referencing another model\'s ID. I\'d look it up myself, but I haven\'t figured out, among all my Ruby on Rails

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 16:23

    :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp,
    :time, :date, :binary, :boolean, :references
    

    See the table definitions section.

提交回复
热议问题