Sha256: 21f4c1bf8dc8f70d7029795812b3c637a314c17e0bc4eea0c0c42665dcaadb65

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

module ActiveScaffold::Config
  class Form < Base
    def initialize(core_config)
      super
      # 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, :marked
        self.columns.exclude *@core.columns.collect{|c| c.name if c.polymorphic_association?}.compact
      end
      @columns
    end
    
    public :columns=
    
    # whether the form should be multipart
    attr_writer :multipart
    def multipart?
      @multipart ? true : false
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_scaffold_vho-4.0.0 lib/active_scaffold/config/form.rb
active_scaffold_vho-3.2.14 lib/active_scaffold/config/form.rb
active_scaffold_vho-3.2.13 lib/active_scaffold/config/form.rb
active_scaffold_vho-3.2.12 lib/active_scaffold/config/form.rb
active_scaffold_vho-3.2.11 lib/active_scaffold/config/form.rb