WYSIWYG editor with image drop-n-drop feature - ruby-on-rails

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).

Related

Is there any way that we can export(generate) editable PDFs in ROR?

I tried looking for different gem including wicked PDF, prawn, prawn forms, pdf-forms etc gems to enable a user to export editable PDFs but these gems weren't helpful. Can anyone guide me about any other gem or plugins that could be used for this purpose.
What you are searching is AcroForm / PDF Interactive Form. You can use PDFTron or Origami. I was using origami gems.
For PDFTron, you can check start from here and here.
For origami you can start from here.
There are hardly any documentation for both, so you have to try a lot until it works like what you want.
I used origami because it is just a gem. Unlike pdftron, I don't have to install anything.

text editor to support uploading image from client rails app to rails api using ckeditor

I have created an CMS API and admin_client app with active resource in rails 4.1.9. Everything is working fine, Now I need a text_editor with image uploading feature in my admin_client app which get stored in CMS API. For that I decided to use "CKEditor" gem.
my question is
whether i can install the gem in both my API(for storing the image and for serving the image to user_client app) and admin_client app(for UI purpose).
Can i install the gem only in my API(for storing the image and for serving the image to user_client app). And use CKEditor plugin in my admin_client(for UI purpose).
Is there any other gem or options to achieve this ?
Please suggest me one of the options to achieve this.
I'm not sure as to the specifics of your request, but I do have experience with CKEditor, so I'll write some musings for you:
--
Install the gem where it's going to be deployed (the JS used)
Yes, but you have to match the models
CKEditor does it well with Paperclip - I'd stick with CKEditor if I were you.
CKEditor's rails gem allows you to use Paperclip to upload the images. We had Paperclip installed anyway, so there was no problem. You may have to install it separately.
When you install Paperclip, you'll get several models:
/ckeditor/asset.rb
/ckeditor/picture.rb
/ckeditor/attachment_file.rb
These are to be put into your backend app (I'm not sure whether that's your API or front-end view) (the generator will do this). This will then give you the ability to save images from your CKEditor.
We have totally changed our models - so I can tell you it works out of the box, as well as if you customize. It's no problem if you want to keep them as they are when put onto your system.
Here's an example of one of our altered models (we have a central table for our assets):
--
The trick will be to make sure your CKEditor instance is able to send the correct assets to your API / backend app.
Since you've not published any code, I can only give you this broad information. If you post some specifics, I may be able to provide more detail if you need it

Rails 4: preview image before upload gem

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.

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.

Rails: Add image upload to existing form

I have an existing entry scaffold. I'd like to add image upload to my existing model/controller/view without too much hassle--and I'd like to add some ajax after I get it working.
That said, I'm pretty new to rails.
I s there a simple, ajax-compatable gem to help?
How do I implement it? (Step-by-step, because I'm pretty slow to learn)
Ruby on Rails AJAX file upload
http://khamsouk.souvanlasy.com/articles/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent
Look for Step 6. Using iframes and responds_to_parent in the article.
Note that it uses attachment_fu for handling file uploads. But the idea is same for both paperclip & carrierwave
Here's a good demo of how to upload images with Rails 3. It uses Uploadify with the Dragonfly gem.
https://github.com/rdetert/FormFly
Same post AJAX upload using Prototype.js plugin
https://github.com/JangoSteve/remotipart
Remotipart is a Ruby on Rails gem enabling AJAX file uploads with jQuery in Rails 3.0 and Rails 3.1 remote forms. This gem augments the native Rails jQuery remote form functionality enabling asynchronous file uploads with little to no modification to your application.
gem 'remotipart', '~> 1.0'
bundle install

Resources