Rails: Add image upload to existing form - ruby-on-rails

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

Related

File Uploading with ruby on rails

at the moment I'm using this: https://github.com/technoweenie/attachment_fu for uploading files.
at the moment i'm running with rails 3.2.12 but soon I want to upgrade to 4.2
can I use this plugin with 4.2 or do I need to use another one?
attachment_fu is a very old plugin and from the github page it appears as if the development has stopped, so I doubt it will support Rails 4+
These are some good alternatives:
https://www.ruby-toolbox.com/categories/rails_file_uploads
Carrierwave and paperclip are the most faous ones and pretty easy to setup.
Paperclip is a smart choice for file uploading. You can use it in rails 3 & 4.

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.

how to get links in UI through sitemap-generator in ruby on rails 2

How to get links in UI through sitemap_generator Gem.
actually, i added the sitemap_generator gem in application and then it generated one xml file also.but, I am not getting the thing that how to generate the links in the web site of application?

How to apply bootstrap to existing rails file generated through scaffold?

through railscasts, I found http://railscasts.com/episodes/328-twitter-bootstrap-basics that with the
gem 'less-rails' (this is the gem https://github.com/seyhunak/twitter-bootstrap-rails)
I can use
rails g bootstrap:themed scaffold-name -f
which applies bootstap to various classes like table, buttons etc. This is amazing timesaver but I am not able to find this for SASS as I am using SASS for my rails app (I am using this gem https://github.com/thomas-mcdonald/bootstrap-sass)
IS there any way to apply bootstap to existing scaffold code as me doing this manually can take lot of time ? OR is there any easy way to put the classes in the .erb files ?
Thanks

Rails, redactor and Paperclip

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!

Resources