class ActiveScaffold::Routing::Association
Public Instance Methods
Source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 28 def call(mapper, options = {}) actions = get_actions(ACTIVE_SCAFFOLD_ASSOCIATION_ROUTING, options) mapper.collection do ActiveScaffold::Routing::ACTIVE_SCAFFOLD_ASSOCIATION_ROUTING[:collection].each do |name, type| mapper.match(name, via: type) if actions.include? name end end mapper.member do ActiveScaffold::Routing::ACTIVE_SCAFFOLD_ASSOCIATION_ROUTING[:member].each do |name, type| mapper.match(name, via: type) if actions.include? name end end end
Source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 13 def default_actions(actions_hash) (actions_hash[:collection].keys + actions_hash[:member].keys).uniq end
Source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 17 def get_actions(actions_hash, options) default_actions = default_actions(actions_hash) if (only = options[:only]) Array(only).map(&:to_sym) elsif (except = options[:except]) default_actions - Array(except).map(&:to_sym) else default_actions end end