Rails, redactor and Paperclip - ruby-on-rails

I just came across RedActor (http://redactorjs.com/), a WYSIWYG-editor. I want to use it in combination with Rails and Paperclip but I don't know where to start. I searched the docs and came across PHP examples for uploading files and images.
Google found nothing for me. (Keywords: Rails Paperclip RedActor). I found this gem (https://github.com/SammyLin/redactor-rails) on GitHub but it only offers integration with ActiveRecord and CarrierWave.
What do I have to do to get RedActor working together with Ruby On Rails and Paperclip?

I'm Sammy and redactor-rails developer.
The redactor-rails gem is only offers integration with ActiveRecord and CarrierWave now.
In future, I will offers integration with paperclip.
Please wait some time.
https://github.com/SammyLin/redactor-rails/issues?state=open
Commit issues if there's anything else i can do to assist you!

Related

How might I be able to link jquery file upload, ajax, and jquery file download on rails?

Thanks!
I'm a complete beginner but I'd like to know even in a generic way so that my users could upload a file to another user's directory, the file gets saved on to a server and the receiving user could download it when the upload gets finished.
Since you're a complete beginner, I won't give you a lot of code; instead, I'll show you the overview of what you can do, and hopefully that will give you a much more refined approach to adopt:
Rails Uploads Using Paperclip
What makes Rails so powerful is the gem ecosystem - these are little plugins which give you functionality outside the scope of the Rails framework. You can get Gems for everything from file uploads to CSS frameworks - all for free
One of the most important & popular gems for Rails is Paperclip (and you have Carrierwave which also does the same job). These are what you use to process image uploads in Rails
Since you're a total beginner, you should really watch this Railscast about how to upload files with Rails using Paperclip:
There are also a lot of other tutorials on Paperclip:
Heroku's Paperclip Tutorial
Simple Paperclip tutorial
Another Paperclup tutorial
I would write some more updates about Paperclip & JQuery, but I think you should get your head around the upload process first

What should i use for rails file attachment and jruby?

Normally I'd use carrierwave, but they do not officially support jruby, and I've been running in to bugs, possibly related. (https://github.com/jnicklas/carrierwave/issues/620, Image corruption on upload to s3, production only. (carrierwave, engineyard))
Have others had success here?
I'm considering trying out paperclip, but it looks like that may not be perfect either-- https://github.com/thoughtbot/paperclip/issues/100
Try dragonfly it's a really great library to manage you file attachment.
check out this guide, it's cake
http://webtempest.com/how-to-allow-image-uploads-in-rails-on-heroku/
It uses paperclip and amazon web s3 gems

CKEditor won't link files (backed by rails, mongoid, paperclip, s3)

I'm having issues with CKEditor. I can upload and insert pictures without issues, but when I try to do the same with files, the link to my file is set to something like javascript:void(0)/*130*/, with the number changing. This is happening on FF/Safari/Chrome.
My app runs on rails 3.1.3, using MongoDB/Mongoid as database/ODM, with paperclip for handling attachments and using S3 for hosting assets. When I explore my bucket I can see that the files are uploaded correctly, so the problem (probably) come from somewhere else. I'm using this gem, and both the rc2 & the master branch doesn't fix that.
Thanks for your time.
Well it's been a while. I solved it by forking the gem (cf ksol/ckeditor), but the diff is too obfuscated to remember what was wrong. Hopefully the original gem is working now.

File uploading rails 3

I have a rails 3 app that has a comment system that allows a user to make comments. What I now wish to do is extend this further by enabling the user to attach/upload files to the comment system. Fairly easy question I am about to ask. What is the best tool/plugin or gem to use so that I can achieve this? I've done some thorough research and found that alot of these plugins such as carrierwave, paperclip and a few others are used to upload photos and I am not trying to do this.
Requirements
User should be able to upload/attach files
Can upload word, powerpoint or execel docuements
Both carrierwave and paperclip can be used to upload any type of files - they have extra features if you want to upload images, but they are not restricted to handling just image files.
In the end it's a matter of preference. I found both paperclip and carrierwave to be very good at what they do.
Paperclip
CarrierWave
As for me CarrierWave more modern and nice solution. Have a try.
You can use even dragonfly - https://github.com/markevans/dragonfly/

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