Sha256: 7923e45c54e9d3f8fe31601fdf931b099810026db322ec7f6a9818e694261924

Contents?: true

Size: 541 Bytes

Versions: 7

Compression:

Stored size: 541 Bytes

Contents

module Spree
  module Api
    class CountriesController < Spree::Api::BaseController
      skip_before_filter :check_for_user_or_api_key
      skip_before_filter :authenticate_user

      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

7 entries across 7 versions & 1 rubygems

Version Path
spree_api-2.0.12 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.11 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.10 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.9 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.8 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.7 app/controllers/spree/api/countries_controller.rb
spree_api-2.0.6 app/controllers/spree/api/countries_controller.rb