Class: DrgcmsFormFields::PasswordField

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

Overview

Implementation of password DRG CMS form field.

Form options:

  • type: password_field (required)

  • name: Field name (required)

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

Form example:

20:
  name: password
  type: pasword_field
  html:
    size: 20

30:
  name: password_confirmation
  type: pasword_field
  html:
    size: 20

Instance Attribute Summary

Attributes inherited from DrgcmsField

#css, #js

Instance Method Summary collapse

Methods inherited from DrgcmsField

#__css_code, get_data, #hash_to_options, #html, #initialize, #record_text_for, #ro_standard, #set_css_code, #set_default_value, #set_initial_value, #set_style, #t

Constructor Details

This class inherits a constructor from DrgcmsFormFields::DrgcmsField

Instance Method Details

#renderObject

Render password field html code



53
54
55
56
57
58
59
# File 'app/models/drgcms_form_fields/password_field.rb', line 53

def render
  return self if @readonly
  @yaml['html'] ||= {}
  record = record_text_for(@yaml['name'])  
  @html << @parent.password_field(record, @yaml['name'], @yaml['html'])
  self
end