Rails Strong Parameter

permitで引っ掛かったときのjsonでresponse

https://github.com/rails/strong_parameters/issues/157

rescue_from ActionController::ParameterMissing do |exception|
  render json: {exception.param => "is required"}, status: 422
end

results matching ""

    No results matching ""