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

Version Path
stitches-3.7.2 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.7.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.6.1 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.6.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.6.0.RC1 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.5.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.4.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.3.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.2.3 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.2.2 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.2.1 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.2.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.1.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb
stitches-3.0.0 lib/stitches/generator_files/app/controllers/api/v2/pings_controller.rb