module ActionDispatch::Routing::Mapper::Base

Public Instance Methods

as_association_routes() click to toggle source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 23
def as_association_routes
  collection do 
    ActionDispatch::Routing::ACTIVE_SCAFFOLD_ASSOCIATION_ROUTING[:collection].each {|name, type| send(type, name)}
  end
  member do
    ActionDispatch::Routing::ACTIVE_SCAFFOLD_ASSOCIATION_ROUTING[:member].each {|name, type| send(type, name)}
  end
end
as_nested_resources(*resources) { || ... } click to toggle source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 32
def as_nested_resources(*resources)
  options = resources.extract_options!
  resources.each do |resource|
    resources(resource, options.merge(:parent_scaffold => merge_module_scope(@scope[:module], parent_resource.plural), :association => resource)) { yield if block_given? }
  end
end
as_routes(options = {:association => true}) click to toggle source
# File lib/active_scaffold/extensions/routing_mapper.rb, line 13
def as_routes(options = {:association => true})
  collection do
    ActionDispatch::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection].each {|name, type| send(type, name)}
  end
  member do
    ActionDispatch::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:member].each {|name, type| send(type, name)}
  end
  as_association_routes if options[:association]
end