Class: Spree::Api::V1::CountriesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/api/v1/countries_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#current_api_user

Instance Method Summary collapse

Methods inherited from BaseController

#map_nested_attributes_keys

Methods included from ControllerSetup

included

Instance Method Details

#indexObject



5
6
7
8
9
10
# File 'app/controllers/spree/api/v1/countries_controller.rb', line 5

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

#showObject



12
13
14
# File 'app/controllers/spree/api/v1/countries_controller.rb', line 12

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