tors / jquery-fileupload-rails-paperclip-example Goto Github PK
View Code? Open in Web Editor NEWAn example rails application that uses the jquery-fileupload-rails and paperclip gems to upload files.
An example rails application that uses the jquery-fileupload-rails and paperclip gems to upload files.
Hello!
I tried to change the code in order to be able to upload multiple files but I did not succeed in it.
I changed:
<%= f.file_field :upload , multiple=>true%>
but after clinking on "Start upload" it could not upload the files and showed me errors.
Could you tell me what I should change?
Many thanks in advanced.
Cheers,
Katja
I'm asking how to add new column(s) in Model "uploads"? I tried to add one line in db/migrate/XXXX_create_uploads.rb:
t.string "upload_user"
and do "rake db:migrate", however, it seems not working. Anyone could help?
I'm trying to use the gem with paperclip. Everything seems to be working fine except that I'm getting Error OK as the status after I try to upload it. Below is what the JS console says when I try to upload it. Also a link to a gist I made with the model, controller, and form partial.
I'm trying to upload a 12.57 KB png image so it should not be my validations tripping it up.
Please help! I've posted this on stack overflow and the support forum and haven't been able to fix it on my own.
https://gist.github.com/spq24/5000772
POST http://localhost:3000/pins 422 (OK) jquery.js:8476
send jquery.js:8476
jQuery.extend.ajax jquery.js:7931
send jquery.fileupload.js:659
$.widget._onSend jquery.fileupload.js:720
(anonymous function) jquery.ui.widget.js:100
newData.submit jquery.fileupload.js:759
$.widget._startHandler jquery.fileupload-ui.js:517
(anonymous function) jquery.ui.widget.js:100
handlerProxy jquery.ui.widget.js:398
jQuery.event.dispatch jquery.js:3046
elemData.handle jquery.js:2722
File >> index.html.erb
When i have uploaded image file success already, my image don't show to preview same before.
I see only the File name and File size. No have image thumbnail
Thanks you
I want to insert a category field with each photo and want to select the category from the drop down, which will be displayed within the table when the image preview is done before the actual upload.
Hi, trying to run it and getting an error:
LoadError in Uploads#index
Showing /rails/jquery-fileupload-rails-paperclip-example/app/views/layouts/application.html.erb where line #5 raised:
cannot load such file -- less
(in /rails/jquery-fileupload-rails-paperclip-example/app/assets/stylesheets/bootstrap_and_overrides.css.less)
Extracted source (around line #5):
2:
3:
4: <title>JqueryFileuploadRailsExample</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8:
How do I configure which directory the file is uploaded too?
Hello I am trying to include a foreign key in the upload.
I have a model properties and I want to include a property_id when it uploads.
I have made the migrations to the database but I don't know how to include it. I have tried making a hidden field and passing the value through there but it comes back with a server error. I have also tried to include it in the def to_jq_upload inside the model but no luck.
Hi,
I'm trying to use the example code in here on my project, but unfortunately, the plugin doesn't seem to be initializing properly. I'm not getting any console errors, and manually running the JS in the console seems to work just fine, other than that nothing happens. I'm afraid I'm totally stumped - do you have any clue what might be going on here?
The markup in this app will not work with strict XHTML rendering.
Specifically you have some tags that are not self-closing such as "br" and "input".
I am trying to move out the 'template-upload' and 'template-download' script to a separate .js file. They seem to be Jquery templates. How can you move them to a different file and then use them in the index.html.erb page
Hey once more!
I have found as well some error-variables in your index.html.erb. I need to have my error messages(in validation) associated to the 'error' key in your json response
Could you please give me a hint how to use different error-messages and how to build them into a code?
I have tried this thing in a controller but it didnt work.
render json: {error: @upload.errors.full_messages}, status: :unprocessable_entity
render json: {error: @upload.errors.full_messages}, status: 422
I guess I need to change a javascript in index.html.erb
Thanks
I install your application for test the upload file , that's work but when I use the Chunk Option, and i display my upload I see Two files upload and not only one. How i can regroup my file ?
Whenever changing <%= f.file_field :upload %> to <%= f.file_field :upload, :multiple => true %> to support multiple file selection it is giving error.
When upgrading to the latest main gem https://github.com/tors/jquery-fileupload-rails the javascript no longer works
Uncaught TypeError: Cannot call method '_adjustMaxNumberOfFiles' of undefined
Reverting to the gem version specified in this example fixes it, I kept all other gem files static
Hello i used your sample code and converted all haml files to erb code in rails 5 and it is working on my development but when i deployed on server or production the select file upload button pops to browse file but when is select file and click open, the file is not getting open i think this is because of "<%= content_tag :body, data: { controller: controller_path, action: action_name } do%>" in application.html.erb and you used this code"= content_tag :body, data: { controller: controller_path, action: action_name } do" in haml; but it is working on development rather in production can you help me to resolve it?
The "Add files" button needs double click on Internet Explorer 10. All other buttons works perfectly.
The "Add files" button woks perfectly also in IE8, Safari, Chrome and Firefox.
(index):154 Uncaught TypeError: fu._adjustMaxNumberOfFiles is not a function
Any idea how can I fix it?
My project can be found here https://github.com/bigos/chrisb-images
I have copied all relevant files from the example project and still get the error.
Does it have anything to do with this issue? blueimp/jQuery-File-Upload#2071
Thank you very much for taking your time to share this example.
The issue is it's way too complicated. There's too much going on in this example that has nothing to do with jquery fileupload or paperclip. There's all sorts of stuff that distracts from the example at hand.
Imagine if someone asked you how to bake an apple pie and you started describing how to create a universe.
As you can see by all the issues, it's better to keep an example simple with no extra fluff. An example should contain the bare minimum to get the point across.
Thank you again.
Hello!
I am modelling your index.html.erb to fit my needs.
Firtsly, i want to get rid of "start" buttom in order to prevent single-file upload (I dont want it), but it seems that "start upload"(multiple upload)-button is on "start" button dependent and I could not find how to modify the script in order to get rid of "start"-buttom but to keep the functionality of a "start upload" -button.
Can you give me some hints how to get rid of those dependencies?
Thank you.
Cheers, Katja
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.