Class: CaringForm::Field::Metadata

Inherits:
Base
  • Object
show all
Defined in:
lib/caring_form/field/metadata.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#apply_to_model, #default_label, #initialize, register, #render

Constructor Details

This class inherits a constructor from CaringForm::Field::Base

Instance Method Details

#input_properties(form, options = {}) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/caring_form/field/metadata.rb', line 16

def input_properties(form, options = {})
  req = {:as => :hidden, :input_html => {}, :label_html => {}}
  if form.index_on.present?
    req[:label_html][:index] = req[:input_html][:index] = form.index_on
  end
  req[:input_html][:name] = name if ancillary
  req.deep_merge!(options)
end

#optionalObject



12
13
14
# File 'lib/caring_form/field/metadata.rb', line 12

def optional
  true
end

#simple_typeObject



8
9
10
# File 'lib/caring_form/field/metadata.rb', line 8

def simple_type
  :hidden
end