class ActiveScaffold::Config::Nested
Attributes
label[W]
the label for this Nested
action. used for the header.
shallow_delete[RW]
instance-level configuration
Public Class Methods
new(core_config)
click to toggle source
Calls superclass method
ActiveScaffold::Config::Base::new
# File lib/active_scaffold/config/nested.rb, line 5 def initialize(core_config) super @label = :add_existing_model self.shallow_delete = self.class.shallow_delete @action_group = self.class.action_group.clone if self.class.action_group end
Public Instance Methods
add_link(attribute, options = {})
click to toggle source
Add a nested ActionLink
# File lib/active_scaffold/config/nested.rb, line 22 def add_link(attribute, options = {}) column = @core.columns[attribute.to_sym] unless column.nil? || column.association.nil? options.reverse_merge! :security_method => :nested_authorized?, :label => column.association.associated_class.model_name.human({:count => 2, :default => column.association.associated_class.name.pluralize}) action_link = @core.link_for_association(column, options) action_link.action ||= :index @core.action_links.add_to_group(action_link, action_group) unless action_link.nil? end end