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
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
Returns the default layout for this controller.
 Optionally raises an exception if the layout could not be found.

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

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