example code for filepicker.io rails drag and drop? -
i'm using filepicker rails gem here:
https://github.com/filepicker/filepicker-rails
i'd convert existing rails upload form use filepicker.io rails gem. existing form uses rails, bootstrap, , datamapper , looks this:
<%= form_for([@user, @photo], html: {multipart: true, remote: true, class: 'photo-upload'} ) |f| %> <%= f.hidden_field :user_id, value: @user.id %> <div class="select-files"> <div class="field"> <%= f.label :image, "select files computer" %> <%= f.file_field :image, multiple: true %> </div> </div> <div class="actions"> <%= f.submit "upload", class: "btn btn-large btn-primary" %> </div> <% end %>
my conversion looks this:
<%= form_for([@user, @photo]) |f| %> <div> <%= f.label :image, "select files computer:" %> <%= f.filepicker_field :image %> </div> <%= f.submit %> <% end %>
i followed documentation on github project, don't file picker dialog. there demo or example code uses filepicker.io rails demonstrate working upload form? found this:
https://github.com/maxtilford/filepicker-rails-demo
but can't working on machine.
you'll want use newer github repo @ https://github.com/filepicker/filepicker-rails
Comments
Post a Comment