Sha256: d5baf32a59880cb51f6187ebcef268755d22a5ea0821254d2c0b1eec9d1d09a0

Contents?: true

Size: 415 Bytes

Versions: 26

Compression:

Stored size: 415 Bytes

Contents

class Api::V1::PingsController < Api::ApiController

  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: "ok" } }, status: (ping_params[:status] || "201").to_i
    end
  end

private

  def ping_params
    params.permit(:error, :status)
  end
end

Version data entries

26 entries across 18 versions & 1 rubygems

Version Path
stitches-5.0.0 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-5.0.0 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-5.0.0.RC1 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-5.0.0.RC1 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.2 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.2 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.2.1 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.1 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC3 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC3 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC2 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC2 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC1 spec/fake_app/app/controllers/api/v1/pings_controller.rb
stitches-4.2.0.RC1 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.0.2 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.1.0RC2 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.0.1 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb
stitches-4.0.0 lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb