Class: Formbuilder::ResponseFieldParagraph

Inherits:
ResponseField
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::TagHelper
Defined in:
app/models/formbuilder/response_field_paragraph.rb

Constant Summary

Constants inherited from ResponseField

Formbuilder::ResponseField::ALLOWED_PARAMS

Instance Attribute Summary

Attributes inherited from ResponseField

#cid, #field_type, #input_field, #options_field, #serialized, #sort_as_numeric

Instance Method Summary collapse

Methods inherited from ResponseField

#audit_response, #has_length_validations?, #length_validations, #min_max_validations, #render_entry_for_table, #validate_response

Instance Method Details

#render_entry(value, opts = {}) ⇒ Object



16
17
18
# File 'app/models/formbuilder/response_field_paragraph.rb', line 16

def render_entry(value, opts = {})
  ActionController::Base.helpers.simple_format(value)
end

#render_input(value, opts = {}) ⇒ Object



11
12
13
14
# File 'app/models/formbuilder/response_field_paragraph.rb', line 11

def render_input(value, opts = {})
  (:textarea, name: "response_fields[#{self.id}]", class: "rf-size-#{self[:field_options]['size']}",
              data: self.length_validations) { value }
end