Sha256: 9ef1e7e433b67b16b31507fed716076d5b3bdddfacc3976cb8c6d106c8d8ad6c
Contents?: true
Size: 566 Bytes
Versions: 26
Compression:
Stored size: 566 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 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
26 entries across 26 versions & 1 rubygems