class ActionController::Responder

def has_errors?


Check whether the resource has errors.
def has_errors?
  resource.respond_to?(:errors) && !resource.errors.empty?
end