Class: Ckeditor::TextArea
- Inherits:
-
Object
- Object
- Ckeditor::TextArea
- Includes:
- ActionView::Helpers::FormTagHelper, ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
- Defined in:
- lib/ckeditor/text_area.rb
Instance Attribute Summary collapse
-
#ck_options ⇒ Object
readonly
Returns the value of attribute ck_options.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template, options) ⇒ TextArea
constructor
A new instance of TextArea.
- #render_instance_tag(object_name, method) ⇒ Object
- #render_tag(name, content) ⇒ Object
Constructor Details
#initialize(template, options) ⇒ TextArea
Returns a new instance of TextArea.
16 17 18 19 20 21 |
# File 'lib/ckeditor/text_area.rb', line 16 def initialize(template, ) @template = template @options = .stringify_keys @ck_options = (@options.delete('ckeditor') || {}).stringify_keys @ck_options['customConfig'] ||= template.asset_path(Ckeditor.js_config_url) if Ckeditor.cdn_enabled? end |
Instance Attribute Details
#ck_options ⇒ Object (readonly)
Returns the value of attribute ck_options.
14 15 16 |
# File 'lib/ckeditor/text_area.rb', line 14 def @ck_options end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/ckeditor/text_area.rb', line 14 def @options end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
14 15 16 |
# File 'lib/ckeditor/text_area.rb', line 14 def template @template end |
Instance Method Details
#render_instance_tag(object_name, method) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/ckeditor/text_area.rb', line 23 def render_instance_tag(object_name, method) tag = build_tag(object_name, method) tag.send(:add_default_name_and_id, ) if ['id'].blank? render tag.respond_to?(:to_text_area_tag) ? tag.to_text_area_tag() : tag.render end |
#render_tag(name, content) ⇒ Object
30 31 32 33 34 |
# File 'lib/ckeditor/text_area.rb', line 30 def render_tag(name, content) ['id'] = sanitize_to_id(['id'] || name) render text_area_tag(name, content, ) end |