2

I'd like my users to be able to upload an image by pasting it into a form.

Is this possible somehow with Rails?

I'd like to do this safely and limit to a single picture upload, not a completely open textarea.

UPDATE:

I'm looking for something like http://pasteboard.co/ that I can add into a form in a Rails app.

Also, with a paperclip hook like https://github.com/galetahub/ckeditor would be nice

Abram
  • 39,950
  • 26
  • 134
  • 184

1 Answers1

1

Although I don't have a specific answer (copy & paste), I do have an answer regarding how to implement the uploading within the DOM:


JQuery

If you use something like jquery-file-upload, you'll be able to incorporate a GUI-based upload process to Rails

I think your question can be answered by taking this technology & applying to the specific element where you'd like to "copy & paste" the image

You can drag & drop images from your system into the example above. This is very similar to the copy & paste functionality you're seeking. I would personally look at this technology, and then apply it to the copy & paste procedure


WYSIWYG

You've referenced GMail as a great example of this -- but you have to remember they're allowing you to paste into a WYSIWYG editor

This is very important, as the upload image element will be handled through the WYSIWYG. You may be able to use this resource to help:

Community
  • 1
  • 1
Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • Hi Rich, good answer. I'm looking for something like http://pasteboard.co/ that I can add into a form in a Rails app. Also, with a paperclip hook like https://github.com/galetahub/ckeditor would be nice – Abram Feb 19 '14 at 09:38
  • Is there any news about this? – Joshua Muheim Apr 07 '15 at 13:08