Sha256: 02d70900895bd0d78e5d89af9073264b1813a94af54aee8400dbbe426fa210f6

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

module Ueditor
  module Helpers
    module FormHelper
      extend ActiveSupport::Concern
      
      include ActionView::Helpers::TagHelper
      include ActionView::Helpers::JavaScriptHelper
      
      def ueditor_area(object_name, method, options = {})
        input_html = (options.delete(:input_html) || {})
        hash = input_html.stringify_keys
        
        instance_tag = ActionView::Base::InstanceTag.new(object_name, method, self, options.delete(:object))
        instance_tag.send(:add_default_name_and_id, hash)
        
        output_buffer = ActiveSupport::SafeBuffer.new
        output_buffer << instance_tag.to_text_area_tag(input_html)
        output_buffer << javascript_tag(Utils.js_replace(hash['id'], options))
        
        output_buffer
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ueditor-0.0.2 lib/ueditor/helpers/form_helper.rb