Sha256: efcf7de25c25bc71c2dda96e56bd336bc17b6c5cbcb86183b7c46425d1df908c

Contents?: true

Size: 434 Bytes

Versions: 3

Compression:

Stored size: 434 Bytes

Contents

module Spree
  module Api
    class CountriesController < Spree::Api::BaseController
      respond_to :json

      def index
        @countries = Country.ransack(params[:q]).result.includes(:states).order('name ASC')
          .page(params[:page]).per(params[:per_page])
        respond_with(@countries)
      end

      def show
        @country = Country.find(params[:id])
        respond_with(@country)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
spree_api-1.3.0 app/controllers/spree/api/countries_controller.rb
spree_api-1.3.0.rc2 app/controllers/spree/api/countries_controller.rb
dup_spree_api-1.3.0.rc1 app/controllers/spree/api/countries_controller.rb