Method: ResourcesController#map_enclosing_resource

Defined in:
lib/resources_controller.rb

#map_enclosing_resource(name, options = {}, &block) ⇒ Object

Creates a resource specification mapping. Use this to specify how to find an enclosing resource that does not obey usual rails conventions. Most commonly this would be a singleton resource.

See Specification#new for details of how to call this

[View source] [View on GitHub]

489
490
491
492
# File 'lib/resources_controller.rb', line 489

def map_enclosing_resource(name, options = {}, &block)
  spec = Specification.new(name, options, &block)
  self.resource_specification_map = resource_specification_map.merge spec.segment => spec
end