0
我的轨道应用程序中有两个相关表:ephemerides
和ephemeris_shared_attributes
。轨道形式的相关表属性
第一个具有ephemedis_shared_attribute_id
列和秒具有列作为year
,yday
等
的ephemeris_shared_attributes
被自动创建当我保存的星历表,但有在它没有值。
如何添加表单字段以输入例如年份并将其保存在ephemeris_shared_attributes table
中?
这是我目前的形式:
= form_for @ephemeris do |f|
...
.field
= f.label :content
= f.text_area :content
.field
= f.label :locale
= f.select(:locale,['mg','fr'])
.actions
= f.submit 'Save'
非常感谢,这真的很有帮助。 –