Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert tinymce changes url...

Replytotopic

tinymce changes url

Posted in Forums : Ask a Rails expert

 
Profile

Authority 0
Posting Rating 69
Sign in to rate this post

Hi,

I’m using tinymce with a custom build link and image plugin.
I now can upload files and images and it is possible to insert them into the text_area.
The urls look like /documents/id/name.
But when I save the entries in my db, the url changes to ../../documents/id/name.

Is there a way to prevent rails form changing the url?

Thanks

 
Me

Authority 62
Posting Rating 78
Sign in to rate this post

I’m guessing tinyMCE itself is changing the URLs to be relative to the page you edited them on. I’d try looking for an option to use absolute links. If you aren’t having luck you can try this hack <%= BODY.gsub(/(\.\.\/)+documents/, ’/documents’) %> to just get something going.

Replytotopic

Other Recent Topics

Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController

Ask a Rails expert : Best way to structure a database for a large/static dataset

Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)

Ask a Rails expert : Above Ground Pool Supplies

Ask a Rails expert : How to get url params in observer or model in Rails 3.1

Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?

Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?

Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )

Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob

Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel