Sha256: 79e516aa409c7691b26e1702c1e0164a26be32c0cd9d6aba51fea4cf2fb0ff99
Contents?: true
Size: 504 Bytes
Versions: 14
Compression:
Stored size: 504 Bytes
Contents
class Api::V2::PingsController < Api::ApiController def create respond_to do |format| format.json do if ping_params[:error] render json: { errors: Stitches::Errors.new([ Stitches::Error.new(code: "test", message: ping_params[:error]) ])} , status: 422 else render json: { ping: { status_v2: "ok" } }, status: (ping_params[:status] || "201").to_i end end end end private def ping_params params.permit(:error, :status) end end
Version data entries
14 entries across 14 versions & 1 rubygems