2
我有一個叫做'確認'的布爾屬性,稱爲用戶的窗體。當我顯示所有用戶或嘗試查看每個用戶時,確認的值始終是空的而不是假,我已經搜索了很多,但我不知道爲什麼會發生這種情況。誰能幫我?布爾在活動管理域返回空而不是false(Rails 3.2/Active Admin)
注意:'確認'顯示爲空,如果它只是假的。
架構遷移:
create_table "users", :force => true do |t|
t.string "name"
t.boolean "confirmed", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
指數功能和形式主動聯繫:
ActiveAdmin.register User do
index do
column :id
column :name
column :confirmed
actions
end
form do |f|
f.inputs "User Details" do
f.input :name
f.input :confirmed
end
f.actions
end
end
怎麼樣查看錶單的情況下?我嘗試了上述方法查看錶單它沒有工作,但它與索引函數 –
一起工作謝謝我已經弄明白了。我將相同的行添加到show方法中。 –