0
出於某種原因,我的某個模型(chart.rb)的「編輯」頁面缺少屬性。ActiveAdmin編輯輸入缺失屬性
簡單地增加
form do |f|
f.semantic_errors
f.inputs
f.actions
end
到chart.rb文件會想念我的屬性被稱爲type
。
如果我添加一個特殊的字段類型,像這樣
form do |f|
f.semantic_errors
f.inputs
inputs 'test' do
input :type
end
f.actions
end
這將正確地呈現在一個不錯的格式輸入的類型,在下面的其他部分。
有誰知道爲什麼f.inputs
可能缺少我的Model屬性之一?
快速編輯: 我做了一個快速的補丁修復用下面的代碼:
form do |f|
f.semantic_errors
f.inputs do
f.input :project
f.input :name
f.input :type
f.input :y_axis
f.input :y_max
f.input :y_min
f.input :x_axis
f.input :x_max
f.input :x_min
end
f.actions
end
,而致形式就好了。但是當試圖保存它時,我在Rails中遇到以下錯誤:
單表繼承機制無法找到子類: 'graph'。發生此錯誤是因爲在類型爲繼承的情況下存儲類「」。如果您不打算將其用於存儲繼承 類,或者覆蓋Chart.inheritance_column以使用另一列作爲 該信息,請重命名此 列。
看起來像列名type
被保留?這是ActiveAdmin預訂嗎?嗯.....
啊,我覺得你得到了它 – mhz