1
據activeamdin文檔中,我們可以這樣做:有沒有辦法在activeadmin批處理操作表單中使用formtastic?
batch_action :flag, form: {
type: %w[Offensive Spam Other],
reason: :text,
notes: :textarea,
hide: :checkbox,
date: :datepicker
} do |ids, inputs|
# inputs is a hash of all the form fields you requested
redirect_to collection_path, notice: [ids, inputs].to_s
end
然而,上述形式並不formtastic和不支持高級配置表(設置窗體窗口的大小)。有沒有什麼辦法可以將它改爲formtastic格式,如:
form do |f|
f.semantic_errors # shows errors on :base
f.inputs # builds an input field for every attribute
f.actions # adds the 'Submit' and 'Cancel' buttons
end