Rails 4: preview image before upload gem - ruby-on-rails

I am looking for gem do preview image before upload image to work in my application Ruby on Rails.
Any suggestion ???

There is a jQuery File Upload Plugin that includes preview functionality. And there is a rails wrapper for it too: https://github.com/tors/jquery-fileupload-rails. I use it successfully in my projects.

I'm not aware of any gems that package this up, but the JavaScript to create an image preview is very easy if your browser supports FileReader API (good browsers and IE 10+). Mozilla has a basic example here.

Related

ActiveStorage::UnpreviewableError

I'm trying to create a PDF preview for my PDF files, but I don't know where to start, I'm using poppler gem on Ruby on Rails.
The app is giving me this message: "ActiveStorage::UnpreviewableError in Tasks#show"
So I'm not understanding where should I need to declare the preview
Looking on google I found several sites with methods, but I don't know where to add this code, I've tried by creating a new folder on the app directory, but this didn't work.
In activestorage documentation says about requirements to use this feature.
libvips v8.6+ or ImageMagick for image analysis and transformations
ffmpeg v3.4+ for video previews and ffprobe for video/audio analysis
poppler or muPDF for PDF previews
Check if in your environment has the requirements
Thanks for the advice, I realized I haven't installed muPDF on my environment, the thing that worked for me was to install it from the home directory (outside my project) and that's it, now the preview is working perfectly fine.
https://ubuntuhandbook.org/index.php/2018/05/install-mupdf-1-3-0-ubuntu-18-04/

CKFinder gem for ruby on rails

I installed the gem ckeditor by tsechingho. But i cant use the edeitor to upload any image on the editor.
Is there any way i can add uplaod images using CKFinder?
CKEditor gem doesn't use CKFinder but allows file/image uploads through a custom file browser.
On the other hand, if you have to use CKFinder, you will need to implement a Rails backend (possibly as an engine like the aforementioned gem). Unfortunately, server side integration docs exist only for v2.

WYSIWYG editor with image drop-n-drop feature

Where can I get a WYSIWYG editor like the one used in github.com? I can drop-n-drop images on the editor while posting a message. Gmail composer in Chrome has a similar function.
Bye the way, I am a rails developer. So rails gem would be plus.
SammyLin / redactor-rails gem can do this for you, in conjunction with an upload gem such as carrierwave (all explained in the documentation).

Using CkEditor in Rails how do I enable image upload from local file system?

i have a rails application using PaperClip with CKEditor version 3.7.
i would like to enable upload of images from the local file system. i see i can use FCKEditor but all i can see is it's applicable for PHP and ASP.Net.
is that another option or do i need to do custom integration?
You can integrate elfinder into ckeditor.
http://elfinder.org/
https://github.com/Studio-42/elFinder/wiki/Integration-with-CKEditor
https://github.com/phallstrom/el_finder
https://github.com/phallstrom/el_finder-rails-example
Disclaimer - I wrote the Rails connector. It's meant for 1.x elfinder, but will work with 2.x using the translater (not everything is supported yet though). I'm working on pure 2.x support now.

file upload progress bar with paperclip on heroku

I need to show a progress bar for file uploads and i have no idea. Any help will be appreciated.
Application is on Heroku and files are on S3
I'd use jQuery file upload which doesn't require flash, only javascript and is compatible with all browser (including IE6): https://github.com/blueimp/jQuery-File-Upload
I wrote the tutorial in the wiki and made a sample app here: https://github.com/apneadiving/Pic-upload---Crop-in-Ajax
Using both jQuery File Upload and Uploadify (on in each branch)
I have written a blog post about using rails 4 with paperclip and uploadify.
http://vignesh.info/blog/rails-4-uploadify-paperclip/
Paperclip already supports aws api and files can be stored on S3. If you have plans of using dropbox take a look at this gem https://github.com/janko-m/paperclip-dropbox

Resources