Module: Ruact::Controller::DocumentRendering

Extended by:
ActiveSupport::Concern
Included in:
Ruact::Controller
Defined in:
lib/ruact/controller/document_rendering.rb

Overview

How a ruact response becomes a full HTML DOCUMENT — the wrapper a browser gets on a normal navigation, as opposed to the raw text/x-component Flight body an in-app navigation gets.

Split out of Ruact::Controller because it answers one self-contained question ("who owns the <head>?") whose answer is load-bearing: the host app's layout does, because stylesheet_link_tag, favicons, fonts, analytics and every <head>-writing gem live there. #ruact_html_shell is the fallback for an app whose layout has not been migrated — it is deliberately minimal and has NO stylesheet slot.

Constant Summary collapse

RUACT_ASSETS_MARKER =

Proof that a host layout called ruact_js_assets: the helper always emits the __FLIGHT_DATA bootstrap script when a payload is present, and render_ruact_document always supplies one. Matching on the payload script (rather than on the entry <script src>) keeps the check true in BOTH dev and production, whose entry tags differ.

"__FLIGHT_DATA"