Generic handlers that make use of the Marten::Handlers::Rendering to render templates (like the Marten::Handlers::Template generic handler for example), should make it possible to easily configure the content type associated with the generated response containing the rendered template. By default, this content type should be text/html but it should be possible to override this by calling a dedicated class method.
The envisioned API is as follows:
class MyHandler < Marten::Handlers::Template
template_name "app/test.xml"
content_type "application/xml"
end
Special care should be taken to ensure that this class method is added at the Marten::Handlers::Rendering concern level in order to ensure that all generic handlers including it also benefit from this capability.
Description
Generic handlers that make use of the
Marten::Handlers::Rendering
to render templates (like theMarten::Handlers::Template
generic handler for example), should make it possible to easily configure the content type associated with the generated response containing the rendered template. By default, this content type should betext/html
but it should be possible to override this by calling a dedicated class method.The envisioned API is as follows:
Special care should be taken to ensure that this class method is added at the
Marten::Handlers::Rendering
concern level in order to ensure that all generic handlers including it also benefit from this capability.