Sha256: cd93a3872dea5591ff874e7ee0c932256b196ed988e8e754f256f07ecfb1db85
Contents?: true
Size: 684 Bytes
Versions: 22
Compression:
Stored size: 684 Bytes
Contents
module CmAdmin module Models class NestedField # NestedField is like a container to hold Field and FormField object attr_accessor :field_name, :display_type, :fields, :associated_fields, :parent_field, :header, :label, :submit_text def initialize(field_name, attributes={}) @field_name = field_name set_default_values attributes.each do |key, value| self.send("#{key.to_s}=", value) end end def set_default_values self.display_type = :table self.fields = [] self.associated_fields = [] self.submit_text = "+ Add #{@field_name.to_s.titleize}" end end end end
Version data entries
22 entries across 22 versions & 1 rubygems