Class: ActiveScaffold::Config::Form
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb
Instance Attribute Summary collapse
- #label ⇒ Object
-
#link ⇒ Object
the ActionLink for this action.
-
#multipart ⇒ Object
writeonly
whether the form should be multipart.
Attributes inherited from Base
Instance Method Summary collapse
-
#columns ⇒ Object
provides access to the list of columns specifically meant for the Form to use.
- #columns=(val) ⇒ Object
-
#initialize(core_config) ⇒ Form
constructor
A new instance of Form.
- #multipart? ⇒ Boolean
Methods inherited from Base
#crud_type, #formats, #formats=, inherited
Methods included from ActiveScaffold::Configurable
Constructor Details
#initialize(core_config) ⇒ Form
Returns a new instance of Form.
3 4 5 6 7 8 9 10 11 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 3 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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
#label ⇒ Object
24 25 26 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 24 def label as_(@label) end |
#link ⇒ Object
the ActionLink for this action
20 21 22 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 20 def link @link end |
#multipart=(value) ⇒ Object (writeonly)
whether the form should be multipart
44 45 46 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 44 def multipart=(value) @multipart = value end |
Instance Method Details
#columns ⇒ Object
provides access to the list of columns specifically meant for the Form to use
29 30 31 32 33 34 35 36 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 29 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 |
#columns=(val) ⇒ Object
38 39 40 41 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 38 def columns=(val) @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val) @columns.action = self end |
#multipart? ⇒ Boolean
45 46 47 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb', line 45 def multipart? @multipart ? true : false end |