Sha256: 714e34b0000f42945fa0b3ce240a07ccb81f3760a75860b799abe860af8f7b8b
Contents?: true
Size: 828 Bytes
Versions: 57
Compression:
Stored size: 828 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, :is_deletable, :is_creatable 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}" self.is_deletable = lambda { |arg| return true } self.is_creatable = lambda { |arg| return true } end end end end
Version data entries
57 entries across 57 versions & 1 rubygems