spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
814 stars 257 forks source link

Broken url on different asset host? #142

Closed lephyrius closed 10 years ago

lephyrius commented 10 years ago

I have the asset_host configured like this:

config.action_controller.asset_host = "//assets.s3.amazonaws.com"

But when I upgraded to TinyMCE 4.1 it changes the URL of the plugins to something like this: //example.com//assets.s3.amazonaws.com/assets/tinymce/plugins/anchor/plugin.js

I cannot figure out why it makes these crazy urls.

spohlenz commented 10 years ago

Is there a reason you can't use an asset host of just "assets.s3.amazonaws.com"?

spohlenz commented 10 years ago

Although it does look like I should add support for protocol-relative asset hosts, I'm wondering what practical difference there is between the two forms.

lephyrius commented 10 years ago

I tried with this but I got the same result:

config.action_controller.asset_host = "assets.s3.amazonaws.com"

//example.com//assets.s3.amazonaws.com/assets/tinymce/plugins/link/plugin.js I dunno how to debug this...

spohlenz commented 10 years ago

Try clearing the cache (rake tmp:cache:clear) and retrying.

cirdes commented 10 years ago

I'm getting the same error here, my assets are on a bucket in S3. The tinymce try to concat my host "//example.com" with the asset path "//assets.s3.amazonaws.com/assets/tinymce/plugins/anchor/plugin.js" and ends with a url like this

//example.com//assets.s3.amazonaws.com/assets/tinymce/plugins/link/plugin.js

instead of only

//assets.s3.amazonaws.com/assets/tinymce/plugins/link/plugin.js
spohlenz commented 10 years ago

Could you please try the latest version in git master?

cirdes commented 10 years ago

@spohlenz, sure! Just a second.

cirdes commented 10 years ago

@spohlenz, now it's working like a charm! :joy_cat:

Thanks!