spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
815 stars 256 forks source link

tinyMCE relative path #106

Closed u007 closed 10 years ago

u007 commented 11 years ago

hi,

well done plugin :+1: ive been trying this on proxy via apache, and due to relative path , the plugin and theme does not load. im not sure why did engine.base did not return relative path.. right now, my work around is to copy assets/javascript/tinymce/preinit.js.erb and replaced base with: base: '<%= Rails.application.config.action_controller.relative_url_root+Rails.application.config.assets.prefix %>/tinymce'

and top of that, ive to add document_base_url into _form to have the images displayed and saved based on root_url path... :document_base_url => root_url this also solve the auto conversion of ../../upload... to ../upload and /upload on edit of content

perhaps you may fix the base issue, and also auto add the document_base_url if its not specified in the tinymce view helper

thanks

toddwf commented 10 years ago

I have this issue as well.

spohlenz commented 10 years ago

I'm not sure why the base path wouldn't be set correctly when relative_url_root is defined, but you can override the base path within your application.rb or config/environments/*.rb by defining config.tinymce.base = "/cms/assets/tinymce". I need to make a note of this in the README.