Sha256: a793c4eace4f8a6c5fb89c863b2d0be5a33e1a345591c40aade55aaa835ad3a5

Contents?: true

Size: 858 Bytes

Versions: 4

Compression:

Stored size: 858 Bytes

Contents

module UeditorRails
  module Helpers
    module ViewHelper
      extend ActiveSupport::Concern

      def ueditor_text_tag(name, content = nil, options = {})
        element_id = sanitize_to_id(options.delete(:id) || name)
        input_html = { :id => element_id, :name => name, :type => 'text/plain' }

        options['initialFrameWidth'] = options.delete(:width) unless options[:width].blank?
        options['initialFrameHeight'] = options.delete(:height) unless options[:height].blank?

        output_buffer = ActiveSupport::SafeBuffer.new
        #output_buffer << content_tag(:script, content, input_html.stringify_keys)
        output_buffer << content_tag(:script, content, input_html.stringify_keys)
        output_buffer << javascript_tag { Util.js_replace(element_id, options.stringify_keys) }
        output_buffer
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ueditor_rails4-0.0.5 lib/ueditor_rails/helpers/view_helper.rb
ueditor_rails-0.0.4 lib/ueditor_rails/helpers/view_helper.rb
ueditor_rails-0.0.2 lib/ueditor_rails/helpers/view_helper.rb
ueditor_rails-0.0.1 lib/ueditor_rails/helpers/view_helper.rb