Class: DrgcmsFormFields::TextField

Inherits:
DrgcmsField show all
Defined in:
app/models/drgcms_form_fields.rb

Overview

Implementation of text_field DRG CMS form field.

Form options:

  • type: text_field (required)

  • name: Field name (required)

  • html: html options which apply to text_field field (optional)

Form example:

10:
  name: title
  type: text_field
  html:
    size: 30

Instance Attribute Summary

Attributes inherited from DrgcmsField

#html, #js

Instance Method Summary collapse

Methods inherited from DrgcmsField

get_data, #hash_to_options, #initialize, #record_text_for, #ro_standard, #set_initial_value, #set_style, #t

Constructor Details

This class inherits a constructor from DrgcmsFormFields::DrgcmsField

Instance Method Details

#renderObject

Render text_field field html code



1313
1314
1315
1316
1317
1318
1319
1320
# File 'app/models/drgcms_form_fields.rb', line 1313

def render
  return ro_standard if @readonly
  set_initial_value
#
  record = record_text_for(@yaml['name'])
  @html << @parent.text_field( record, @yaml['name'], @yaml['html']) 
  self
end