PerfectlyNormal / tinymce-rails-imageupload

Image upload plugin for TinyMCE and Rails with the asset pipeline
MIT License
149 stars 154 forks source link

Fix 'uploadDone' function to be able to use json as content type #94

Closed elmasantos closed 6 years ago

elmasantos commented 6 years ago

When responding with some content in the controller, the plugin was getting the HTML content through the "body" tag, but content types such as application/json or text/plain has the "pre" tag instead of "body".

This PR fixes the uploadDone function to use the "body" tag with html content type and "pre" with others, so the response in controller can now be application/json without problems.

7