Skip to content

Commit

Permalink
Use render html instead of text
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed Oct 8, 2016
1 parent 1b97143 commit 5f7e71c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ckeditor/asset_response.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require 'action_view/helpers/tag_helper'
require 'action_view/helpers/javascript_helper'

module Ckeditor
class AssetResponse
include ActionView::Helpers::TagHelper
include ActionView::Helpers::JavaScriptHelper

FUNCTION = 'window.parent.CKEDITOR.tools.callFunction'.freeze
Expand Down Expand Up @@ -50,7 +52,7 @@ def success_json(_relative_url_root = nil)

def success_ckeditor(relative_url_root = nil)
{
text: javascript_tag("#{FUNCTION}(#{params[:CKEditorFuncNum]}, '#{asset_url(relative_url_root)}');")
html: javascript_tag("#{FUNCTION}(#{params[:CKEditorFuncNum]}, '#{asset_url(relative_url_root)}');")
}
end

Expand All @@ -68,7 +70,7 @@ def errors_json

def errors_ckeditor
{
text: javascript_tag("#{FUNCTION}(#{params[:CKEditorFuncNum]}, null, '#{error_message}');")
html: javascript_tag("#{FUNCTION}(#{params[:CKEditorFuncNum]}, null, '#{error_message}');")
}
end

Expand Down

0 comments on commit 5f7e71c

Please sign in to comment.