← Graph

respond_to Anti-Pattern

concept 2 connections

Rails pattern of responding with multiple formats (HTML, JSON, XML, PDF, RSS) from one action using respond_to. Ivan argues that at small scale it looks innocent but at any nontrivial scale — four or five formats across multiple actions in one controller — it is the wrong abstraction: different waves require different data, different tools, and different behaviors. The fix is separate top-level controller namespaces per wave of usage, not respond_to blocks.

category
practice
about
respond_to Anti-Pattern concept
Critiques respond_to for mixing incompatible waves of usage in one controller.
about
respond_to Anti-Pattern concept
Replacement for respond_to-based multi-format actions.

Provenance

Read by
8 extractions