Sha256: c326e2e7ca4de8fb4d4359b8bdb1fc5f871d8695c11fe37b2112c05c252dd9ef
Contents?: true
Size: 1.3 KB
Versions: 101
Compression:
Stored size: 1.3 KB
Contents
module ActiveScaffold::Config class Form < Base def initialize(core_config) @core = core_config # start with the ActionLink defined globally @link = self.class.link.clone # no global setting here because multipart should only be set for specific forms @multipart = false end # global level configuration # -------------------------- # instance-level configuration # ---------------------------- # the ActionLink for this action attr_accessor :link # the label for this Form action. used for the header. attr_writer :label def label as_(@label) end # provides access to the list of columns specifically meant for the Form to use def columns unless @columns # lazy evaluation self.columns = @core.columns._inheritable self.columns.exclude :created_on, :created_at, :updated_on, :updated_at self.columns.exclude *@core.columns.collect{|c| c.name if c.polymorphic_association?}.compact end @columns end def columns=(val) @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val) @columns.action = self end # whether the form should be multipart attr_writer :multipart def multipart? @multipart ? true : false end end end
Version data entries
101 entries across 101 versions & 4 rubygems