A controller layer which provides a convenient way to respond to different requested content types. The order in which you add converters matters, as it determines how the incoming Accept: header is mapped, e.g. the first converter is also defined as matching the media range /.
def process!(request, path)
Invokes super. If a response is generated, format it based on the Accept: header, unless the content type was already specified.
def process!(request, path) if response = super headers = response # Don't try to convert the response if a content type was explicitly specified. if headers[HTTP::CONTENT_TYPE] return response else return self.response_for(request, response) end end end