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