Sha256: 91df2cae25207b665513e96d52bd257a2e0ad15acff1598a36d3521311f9e1aa
Contents?: true
Size: 595 Bytes
Versions: 21
Compression:
Stored size: 595 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? head :no_content, options.reverse_merge(content_type: 'application/json') elsif resource.errors.any? render options.reverse_merge(status: :unprocessable_entity, json: {errors: resource.errors}) else render options.reverse_merge(json: resource) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems