Class: CckForms::ParameterTypeClass::Text

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/cck_forms/parameter_type_class/text.rb

Overview

Represents a long text string (TEXTAREA).

Instance Method Summary collapse

Instance Method Details

#build_form(form_builder, options) ⇒ Object

Builds a TEXTAREA



7
8
9
10
# File 'lib/cck_forms/parameter_type_class/text.rb', line 7

def build_form(form_builder, options)
  set_value_in_hash options
  form_builder.text_area :value, {cols: 50, rows: 5, class: 'form-control'}.merge(options)
end

#to_diff_value(options = {}) ⇒ Object

Wraps DIFF output to .wall (bootstrap-specific bounded block)



13
14
15
16
17
# File 'lib/cck_forms/parameter_type_class/text.rb', line 13

def to_diff_value(options = {})
  to_html(options).presence.try do |html|
    "<div class='well well-small'>#{html}</div>".html_safe
  end
end