class Api::V1::PingsController
Public Instance Methods
create()
click to toggle source
# File lib/stitches/generator_files/app/controllers/api/v1/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: "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/v1/pings_controller.rb, line 13 def ping_params params.permit(:error, :status) end