Module: DocsKit::Scoping

Included in:
LlmsController, McpController, SearchController
Defined in:
lib/docs_kit/scoping.rb

Overview

Wraps a controller's actions in the request's DocsKit::Scope, so everything rendered or enumerated during the action (Configuration#nav_groups, LlmsText.pages, the search index) sees the same version the URL asked for. Included by the gem's own controllers (Llms, Search, Mcp); a host's docs controller gets the same behavior from DocsKit::Controller#render_page's own wrapper instead — including this module there would around_action every host action, which is not docs-kit's call to make.

A plain module with an included hook, not an ActiveSupport::Concern — it has no dependency chain and stays loadable in the Rails-free suite.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



15
16
17
# File 'lib/docs_kit/scoping.rb', line 15

def self.included(base)
  base.around_action :docs_scope
end