我是从桌子上摘下来的
#<Section id: 12, name: "Seccion 1", created_at: "2018-07-24 15:06:34", updated_at: "2018-07-24 15:06:34", quotation_id: 62, order: 0>
但是我想将其转换为哈希
name_seccions.each do | section |
section.quotation_id = event_current
#Convert to hash
puts section.inspect
end
答案 0 :(得分:1)
section_hash = section.attributes