module ActionController::ImplicitRender
def default_render
def default_render if template_exists?(action_name.to_s, _prefixes, variants: request.variant) render elsif any_templates?(action_name.to_s, _prefixes) message = "#{self.class.name}\##{action_name} is missing a template " \ "for this request format and variant.\n" \ "\nrequest.formats: #{request.formats.map(&:to_s).inspect}" \ "\nrequest.variant: #{request.variant.inspect}" raise ActionController::UnknownFormat, message elsif interactive_browser_request? message = "#{self.class.name}\##{action_name} is missing a template for request formats: #{request.formats.map(&:to_s).join(',')}" raise ActionController::MissingExactTemplate, message else logger.info "No template found for #{self.class.name}\##{action_name}, rendering head :no_content" if logger super end end
def interactive_browser_request?
def interactive_browser_request? request.get? && request.format == Mime[:html] && !request.xhr? end
def method_for_action(action_name)
def method_for_action(action_name) super || if template_exists?(action_name.to_s, _prefixes) "default_render" end end