module ActionController::Renderers::ClassMethods
def use_renderers(*args)
You must specify a `use_renderer`, else the `controller.renderer` and
end
end
render json: record
def show
use_renderers :json
include ActionController::Renderers
include ActionController::Rendering
include AbstractController::Rendering
class MetalRenderingController < ActionController::Metal
the `:json` renderer (`_render_with_renderer_json`) might look like:
name or names to `use_renderers`. For example, a controller that includes only
renderers, you may specify which renderers to include by passing the renderer
Rather than including ActionController::Renderers::All and including all
ActionController::Renderers, and have at least one renderer.
include AbstractController::Rendering, ActionController::Rendering, and
Since ActionController::Metal controllers cannot render, the controller must
controller. See Renderers::RENDERERS and Renderers.add.
ActionController::Renderers::All, making all renderers available in the
Both ActionController::Base and ActionController::API include
otherwise to add an available renderer proc to a specific controller.
It is useful when rendering from an ActionController::Metal controller or
within controller actions.
Adds, by name, a renderer or renderers to the `_renderers` available to call
def use_renderers(*args) renderers = _renderers + args self._renderers = renderers.freeze end