我在rails视图中有一个带有dropzone和file_tags的表单:
<%= form_tag '/media_contents', method: :post, class: 'dropzone form', id: 'media-dropzone' do %>
<div class="fallback">
<%= file_field_tag 'media', multiple: true %>
</div>
<% end %>
当我开始显示html视图时,我得到了这个类:
<form method="post" accept-charset="UTF-8" action="/media_contents" id="media-dropzone" class="dropzone form">
<input type="hidden" value="✓" name="utf8">
<input type="hidden" value="ksbt9hMvy3RCzFzqiRJpq+MBw5gbqy/rlWZ7mL1tOGnRjfv+CRWdLrVCdxXJyFCYL73A5H4Vb9lWl+fRA4rE7Q=="
name="authenticity_token">
<div class="fallback">
<input type="file" multiple="multiple" id="media" name="media">
</div>
</form>
&#13;
但是在我重新加载这个页面后,我在文件输入中获得了新的html元素:
<form method="post" accept-charset="UTF-8" action="/media_contents" id="media-dropzone" class="dropzone form dz-clickable">
<input type="hidden" value="✓" name="utf8">
<input type="hidden" value="WZZn20j4veF2OtEMK12qR06tkGtPpNsgst/Kkan9SyAa3XHTUsLru4G0+vNrh5N0ghGTFyoamxJxLlbYFxq3pA=="
name="authenticity_token">
<div class="dz-default dz-message"><span>Drop files here to upload</span></div></form>
&#13;
我想得到第二个视图,而不是第一个视图。但我不知道为什么,以及如何删除第一个视图。请帮忙