葡萄文档说: The rescue_from block must return a Rack::Response object, call error! or re-raise an exception. 但如果我们用rescue_from方法只记录的东西,我们要保持原有的HTTP回答我们应该回报? 如果我重新抛出catched异常,它不会保持原来的行为。 例如,我的一些测试产生400反应,但有
我使用active_model_serializer 0.10.0.rc5和grape gem作为api。 我有一个终点后像这样: class V1::Endpoints::Posts < Grape::API
resource :posts do
desc 'Returns a list of posts.'
# serializing array
get
我想为我的行动做一个参数验证检查。但不知何故,它不工作。有人可以建议我怎么做。以下是我的代码。如果我发送没有任何参数的请求,则参数验证不会发生。我可以知道原因吗?请问我该如何解决这个问题。 module API
module V1
class Permissions < Grape::API
include Defaults
helpers do
我正在建立API终端Grape。 我有以下scope: class JourneyPolicy < ApplicationPolicy
def create?
user && user.identt_id == record
end
class Scope
attr_reader :user, :scope
def initiali