ActiveAdmin表单:
我的问题:我无法获得包含多个选择文件的表单(
我试过了:
ActiveAdmin.register Foto do:
form :html => { :multipart => true } do |f|
f.inputs "Upload" do
f.input :foto, :as => :file
end
f.actions
end
end
这不起作用,然后我用两种形式制作了一个简单的html页面:
<!DOCTYPE doctype html>
<html>
<head>
</head>
<body>
<!--**not** work multiple choice files-->
<form accept-charset="UTF-8" action="#" enctype="multipart/form-data" method="post">
<input id="image" name="image" type="file"/>
</form>
<!--**great** work multiple choice files-->
<form accept-charset="UTF-8" action="#" method="post">
<input id="image" name="image" type="file" multiple=""/>
</form>
</body>
</html>
问题:如何向多个输入字段添加属性?
我试过了:
f.input :foto, :as => :file, :html => {:multiple => ""}
f.input :foto, :as => :file, :html => {:multiple => ""}
f.input :foto, :as => :file, :html => {"multiple" => "multiple"}
f.input :foto, :as => :file, :html => {:multiple => :multiple}
这不起作用
请帮帮我。
你应该用
f.input :foto, as: :file, input_html: { multiple: true }
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句