class Api::V2::PingsController

Public Instance Methods

create() click to toggle source
# File lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb, line 3
def create
  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

Private Instance Methods

ping_params() click to toggle source
# File lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb, line 13
def ping_params
  params.permit(:error, :status)
end