Sha256: 9cd29dc80d656923d487729c9845ce4f178b72522118ca00cc994e8be0c5ab72
Contents?: true
Size: 541 Bytes
Versions: 19
Compression:
Stored size: 541 Bytes
Contents
# frozen_string_literal: true module Alchemy class Api::BaseController < Alchemy::BaseController layout false rescue_from CanCan::AccessDenied, with: :render_not_authorized rescue_from ActiveRecord::RecordNotFound, with: :render_not_found rescue_from ActionController::RoutingError, 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
19 entries across 19 versions & 1 rubygems