Module: Plutonium::Routing::MapperExtensions

Defined in:
lib/plutonium/routing/mapper_extensions.rb

Overview

MapperExtensions module provides additional functionality for route mapping in Plutonium applications.

This module extends the functionality of Rails’ routing mapper to support Plutonium-specific features, such as resource registration and custom route materialization.

Examples:

Usage in a Rails routes file

Blorgh::Engine.routes.draw do
  register_resource SomeModel
end

Instance Method Summary collapse

Instance Method Details

#register_resource(resource, options = {}) { ... } ⇒ void

This method returns an undefined value.

Registers a resource for routing and sets up associated routes.

Yields:

  • An optional block for additional resource configuration.



21
22
23
24
25
# File 'lib/plutonium/routing/mapper_extensions.rb', line 21

def register_resource(resource, options = {}, &)
  route_config = route_set.register_resource(resource, options, &)
  define_resource_routes(route_config, resource)
  resource_route_concern_names << route_config[:concern_name]
end