Sha256: 5b756df6e7efc8d542b7c4b3a6aa3f285ed93e60ddff244b2e3595fbb6f2b08f
Contents?: true
Size: 562 Bytes
Versions: 37
Compression:
Stored size: 562 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
37 entries across 37 versions & 1 rubygems