Sha256: 42a23352684d46a557d00347ba409b10af27a63839be5917e2b6475f90eb17d0
Contents?: true
Size: 498 Bytes
Versions: 39
Compression:
Stored size: 498 Bytes
Contents
# frozen_string_literal: true 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
39 entries across 39 versions & 1 rubygems