Pasting images in TinyMCE on rails app
- by Sam Kong
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