Sha256: 8a431fe87d40f26364151480ec8707d46ef8c1030fa3c09d6e6154899e350637
Contents?: true
Size: 498 Bytes
Versions: 62
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
62 entries across 62 versions & 1 rubygems