Sha256: 54a5bc5bf75f7cd888c44fca671253a4a01243b3dc7065423a91c804d74aad2a
Contents?: true
Size: 467 Bytes
Versions: 5
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
5 entries across 5 versions & 1 rubygems