0
我尝试从选择框中选择文件夹,并从罚款上传作为参数发送请求。但发送null。我的代码低于Rails罚款上传选择文件夹从选择框
//haml codes
- path = "#{Rails.root}/public/templates/custom/"
- folders = Dir["#{path}*"]
%select#selected_path.form-control{name: 'folder'}
%option{disabled: "disabled", selected: "selected"} Select
- folders.each do |folder|
%option{value: "#{Rails.root + folder}"}
- if File.directory? folder
= folder
对于js代码
$('#fine-uploader-gallery').fineUploader({
template: 'qq-template-gallery',
request: {
endpoint: '/admin/files/upload',
params: {
authenticity_token: "<%= form_authenticity_token %>",
// gecici path eklendi
selected_path: $('#selected_path').change(function() {
alert($('#selected_path option:selected').val());
$('#selected_path option:selected').val()
})
}
}
});
但上述selected_path PARAMS给我的错误。从js "selected_path"=>"[object HTMLSelectElement]"
返回错误,不是路径。我该如何解决这个问题? 预先感谢您