Module: Ckeditor::Helpers::FormHelper

Extended by:
ActiveSupport::Concern
Includes:
ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
Defined in:
lib/ckeditor/helpers/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#cktext_area(object_name, method, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ckeditor/helpers/form_helper.rb', line 9

def cktext_area(object_name, method, options = {})
  options = { :language => I18n.locale.to_s }.merge(options)
  input_html = (options.delete(:input_html) || {}).stringify_keys
  js_content_for_section = options.delete(:js_content_for)
  
  instance_tag = ActionView::Base::InstanceTag.new(object_name, method, self, options.delete(:object))
  instance_tag.send(:add_default_name_and_id, input_html)
  
  output_buffer = ActiveSupport::SafeBuffer.new
  output_buffer << instance_tag.to_text_area_tag(input_html)
  
  js = Utils.js_replace(input_html['id'], options)
  
  output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
  output_buffer
end