Class: Spree::Api::V1::CountriesController
- Inherits:
-
BaseController
- Object
- ActionController::Metal
- BaseController
- Spree::Api::V1::CountriesController
show all
- Defined in:
- app/controllers/spree/api/v1/countries_controller.rb
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys
included
Instance Method Details
#index ⇒ Object
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
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/spree/api/v1/countries_controller.rb', line 12
def show
@country = Country.find(params[:id])
end
|