Module: Ckeditor::Helpers::ViewHelper

Extended by:
ActiveSupport::Concern
Defined in:
lib/ckeditor/helpers/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#cktext_area_tag(name, content = nil, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ckeditor/helpers/view_helper.rb', line 6

def cktext_area_tag(name, content = nil, options = {})
  element_id = sanitize_to_id(options[:id] || name)
  options = { :language => I18n.locale.to_s }.merge(options)
  input_html = { :id => element_id }.merge( options.delete(:input_html) || {} )
  js_content_for_section = options.delete(:js_content_for)
  
  output_buffer = ActiveSupport::SafeBuffer.new
  output_buffer << text_area_tag(name, content, input_html)
  
  js = Utils.js_replace(element_id, options)
  
  output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
  output_buffer
end