Sha256: b2951fdab0c4a9bfc0f51247efe9755d59f962d8bb2d849c4719762ff53a1a6f

Contents?: true

Size: 400 Bytes

Versions: 10

Compression:

Stored size: 400 Bytes

Contents

require_dependency "addresses/application_controller"

module Addresses
  class ZipcodesController < ApplicationController
    def show
      @zipcode = Zipcode.find_or_create_by_service(params[:zipcode])

      if @zipcode.nil?
        render json: { errors: ['Zipcode not found'] }, success: false, status: :unprocessable_entity
      else
        render json: @zipcode
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
addresses-1.0.11 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.9 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.8 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.7 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.6 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.5 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.4 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.3 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.2 app/controllers/addresses/zipcodes_controller.rb
addresses-1.0.1 app/controllers/addresses/zipcodes_controller.rb