Class: ActiveScaffold::Config::Nested
- Defined in:
- lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb
Constant Summary collapse
- @@shallow_delete =
false
Instance Attribute Summary collapse
- #label ⇒ Object
-
#shallow_delete ⇒ Object
instance-level configuration —————————-.
Attributes inherited from Base
Instance Method Summary collapse
-
#add_link(label, models, options = {}) ⇒ Object
Add a nested ActionLink.
-
#initialize(core_config) ⇒ Nested
constructor
A new instance of Nested.
Methods inherited from Base
#crud_type, #formats, #formats=, inherited
Methods included from ActiveScaffold::Configurable
Constructor Details
#initialize(core_config) ⇒ Nested
Returns a new instance of Nested.
5 6 7 8 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb', line 5 def initialize(core_config) @core = core_config self.shallow_delete = self.class.shallow_delete end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
#label ⇒ Object
29 30 31 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb', line 29 def label @label ? as_(@label) : as_(:add_existing_model, :model => @core.label) end |
#shallow_delete ⇒ Object
instance-level configuration
17 18 19 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb', line 17 def shallow_delete @shallow_delete end |
Instance Method Details
#add_link(label, models, options = {}) ⇒ Object
Add a nested ActionLink
20 21 22 23 24 25 |
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb', line 20 def add_link(label, models, = {}) .merge! :label => label, :type => :record, :security_method => :nested_authorized?, :position => :after, :parameters => {:associations => models.join(' ')} [:html_options] ||= {} [:html_options][:class] = [[:html_options][:class], models.join(' ')].compact.join(' ') @core.action_links.add('nested', ) end |