Sha256: 1aca1b6fd56000d60cf0e4c4bd4f5fc4284ccf6af8491ad62c99a17b1e2da6a4
Contents?: true
Size: 528 Bytes
Versions: 22
Compression:
Stored size: 528 Bytes
Contents
module Api module Rendering private def render_resources(resources, options = {}) options[:json] = resources render options end def render_resource(resource, options = {}) if resource.destroyed? options[:status] = :no_content options[:text] = nil elsif resource.errors.any? options[:json] = {errors: resource.errors} options[:status] = :unprocessable_entity else options[:json] = resource end render options end end end
Version data entries
22 entries across 22 versions & 1 rubygems