Sha256: 90e452f2fa1bcc37efe4d0568accc84af890f8b8b753bab51739a6988fc8a82f
Contents?: true
Size: 588 Bytes
Versions: 25
Compression:
Stored size: 588 Bytes
Contents
module Shipit 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 end
Version data entries
25 entries across 25 versions & 1 rubygems