Pasting images in TinyMCE on rails app
Posted
by Sam Kong
on Stack Overflow
See other posts from Stack Overflow
or by Sam Kong
Published on 2010-03-23T08:48:44Z
Indexed on
2010/03/23
8:53 UTC
Read the original article
Hit count: 417
ruby-on-rails
|tinymce
Hi,
I found a weird problem with TinyMCE editor. Copying & pasting images from another domain works fine but if the images are on the same domain the path are relative but not correct sometimes. I figured out that the problem is related to the rails URL scheme.
Example)
Images are copied from http://mydomain.com/index.html page and the real images path is http://mydomain.com/photos/image.jpg.
Editor page:
http://mydomain.com/posts/new => image path is set as ../photos/image.jpg
http://mydomain.com/posts/edit/123 => image path is set as ../../photos/image.jpg
So I tried http://mydomain.com/posts/new/ and it worked.
How do I solve this problem?
Thanks.
Sam
© Stack Overflow or respective owner