Skip to main content

Module respond

Module respond 

Source
Expand description

Format-based content negotiation (Rails respond_to).

Context::negotiated_format picks a Format from the request (a .json/.html path extension wins, else the Accept header), and Context::respond_to returns a RespondTo builder that runs the branch matching that format.

Structs§

RespondTo
Builder that evaluates only the branch matching the negotiated format.

Enums§

Format
A negotiated response format. Any matches the first branch offered.