Collections 简单表单设置整数集合的默认值失败,原因是什么?

Collections 简单表单设置整数集合的默认值失败,原因是什么?,collections,default,simple-form,Collections,Default,Simple Form,尝试为简单形式的整数集合设置选定值总是失败!为什么这是非常令人沮丧的,我不明白为什么 打印@profile.age在视图中正确显示值19 视图: 结果: defaults to 18 to defaults to 18 defaults to 18 视图: 结果: defaults to 18 to defaults to 18 defaults to 18 添加:selected=>“#{@profile.age.to_s} 结果: defaults to 18 to

尝试为简单形式的整数集合设置选定值总是失败!为什么这是非常令人沮丧的,我不明白为什么

打印@profile.age在视图中正确显示值19

视图:

结果:

 defaults to 18
 to defaults to 18
defaults to 18
视图:

结果:

 defaults to 18
 to defaults to 18
defaults to 18
添加:selected=>“#{@profile.age.to_s}

结果:

 defaults to 18
 to defaults to 18
defaults to 18