Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. autoProcessQueue:false
  2.  
  3. <%=form_for @listing, :html=> { class:'ui form centered black segment'} do |f|%>
  4.  
  5. <div class="required field">
  6. <label>Title</label>
  7. <%=f.text_field :title,placeholder:'Title of the listing'%>
  8. </div>
  9.  
  10. <div class="field ui segment dropzone dropzone-previews" id='my-dropzone'>
  11. <p class="dz-message">You can drop an image here or click to upload."
  12. </p>
  13. </div>
  14.  
  15. <script type="text/javascript">
  16. Dropzone.autoDiscover=false;
  17. var myDropzone=new Dropzone("#my-dropzone",
  18. {
  19. autoProcessQueue:false,
  20. url:'/listings',
  21. paramName:"file",
  22. addRemoveLinks:true,
  23. previewsContainer:'.dropzone-previews',
  24. headers:
  25. {
  26. 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
  27. }
  28.  
  29.  
  30. });
  31. $('.ui.submit').click(function(e){
  32.  
  33. myDropzone.autoProcessQueue();
  34. });
  35. </script>
  36.  
  37. <%end%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement