我的 Rails 3 应用程序有问题:我的视图中有一个脚本来显示上传进度条(上传过程有效):
<h1>Ajouter des images:</h1>
<%= form_for [:admin, :gallery, @painting], html: { multipart: true} do |f| %>
<%= f.hidden_field :gallery_id %>
<%= f.label :image, "Upload paintings:" %>
<%= f.file_field :image, multiple: true, name: "painting[image]" %>
<% end %>
<script id="template-upload" type="text/x-tmpl">
<div class="upload">
{%=o.name%}
<div class="progress"><div class="bar" style="width: 0%"></div></div>
</div>
</script>
但是当我尝试上传文件时,我收到了这个错误:
Uncaught Error: Syntax error, unrecognized expression: <div class="upload">
Argentina.gif
<div class="progress"><div class="bar" style="width: 0%"></div></div>
</div>
来自 jquery.js 文件:
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
我真的不知道如何解决它,我已经寻求了很多!谢谢你的帮助 !