class ActionController::Responder

def to_format


responds to :to_format and display it.
template, if the template is not available, we verify if the resource
All other formats follow the procedure below. First we try to render a
def to_format
  if !get? && has_errors? && !response_overridden?
    display_errors
  elsif has_view_rendering? || response_overridden?
    default_render
  else
    api_behavior
  end
rescue ActionView::MissingTemplate
  api_behavior
end