Class: Formbuilder::ResponseFieldParagraph
- Inherits:
-
ResponseField
- Object
- ActiveRecord::Base
- ResponseField
- Formbuilder::ResponseFieldParagraph
- 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, #search_type, #serialized, #sort_as_numeric
Instance Method Summary collapse
- #render_entry(value, opts = {}) ⇒ Object
- #render_entry_text(value, opts = {}) ⇒ Object
- #render_input(value, opts = {}) ⇒ Object
Methods inherited from ResponseField
#audit_response, #before_response_destroyed, #has_length_validations?, #length_validations, #min_max_validations, #normalize_response, #options_array, #sortable_value, #transform_raw_value, #validate_response
Instance Method Details
#render_entry(value, opts = {}) ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/models/formbuilder/response_field_paragraph.rb', line 24 def render_entry(value, opts = {}) if value.present? ActionController::Base.helpers.simple_format(Rinku.auto_link(value)) else '' end end |
#render_entry_text(value, opts = {}) ⇒ Object
32 33 34 |
# File 'app/models/formbuilder/response_field_paragraph.rb', line 32 def render_entry_text(value, opts = {}) value end |
#render_input(value, opts = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/models/formbuilder/response_field_paragraph.rb', line 14 def render_input(value, opts = {}) content_tag( :textarea, name: "response_fields[#{self.id}]", id: "response_fields_#{self.id}", class: "rf-size-#{self[:field_options]['size']}", data: self.length_validations ) { value } end |