Class: Occams::Content::Tag::TextArea

Inherits:
Fragment show all
Defined in:
lib/occams/content/tags/textarea.rb

Overview

Tag for text content that is going to be rendered using textarea

{{ cms:textarea identifier }}

Instance Attribute Summary

Attributes inherited from Fragment

#identifier, #namespace, #options, #renderable

Attributes inherited from Occams::Content::Tag

#context, #params, #source

Instance Method Summary collapse

Methods inherited from Fragment

#content, #form_field_id, #fragment, #initialize, #render

Methods inherited from Occams::Content::Tag

#allow_erb?, #content, #initialize, #nodes, #render

Constructor Details

This class inherits a constructor from Occams::Content::Tag::Fragment

Instance Method Details

#form_field(object_name, view, index) {|input| ... } ⇒ Object

Yields:

  • (input)


7
8
9
10
11
12
13
# File 'lib/occams/content/tags/textarea.rb', line 7

def form_field(object_name, view, index)
  name    = "#{object_name}[fragments_attributes][#{index}][content]"
  options = { id: form_field_id, data: { 'cms-cm-mode' => 'text/html' } }
  input   = view.send(:text_area_tag, name, content, options)

  yield input
end