module ActionView::Layouts

def _default_layout(lookup_context, formats, require_layout = false)

* template - The template object for the default layout (or +nil+)
==== Returns

an +ArgumentError+ exception is raised (defaults to +false+)
* require_layout - If set to +true+ and layout is not found,
* formats - The formats accepted to this layout
==== Parameters

Optionally raises an exception if the layout could not be found.
Returns the default layout for this controller.
def _default_layout(lookup_context, formats, require_layout = false)
  begin
    value = _layout(lookup_context, formats) if action_has_layout?
  rescue NameError => e
    raise e, "Could not render layout: #{e.message}"
  end
  if require_layout && action_has_layout? && !value
    raise ArgumentError,
      "There was no default layout for #{self.class} in #{view_paths.inspect}"
  end
  _normalize_layout(value)
end