Sha256: 3c689f4c3d4d4bc86d2390038f71780b5d7cf7e18897739d4b533970d5b68b15
Contents?: true
Size: 467 Bytes
Versions: 35
Compression:
Stored size: 467 Bytes
Contents
module Alchemy class Api::BaseController < Alchemy::BaseController layout false respond_to :json rescue_from CanCan::AccessDenied, with: :render_not_authorized rescue_from ActiveRecord::RecordNotFound, with: :render_not_found private def render_not_authorized render json: {error: 'Not authorized'}, status: 403 end def render_not_found render json: {error: 'Record not found'}, status: 404 end end end
Version data entries
35 entries across 35 versions & 2 rubygems