Class: Spree::Api::CountriesController
Instance Attribute Summary
#current_api_user
Instance Method Summary
collapse
#map_nested_attributes_keys, #set_jsonp_format
included
Instance Method Details
#index ⇒ Object
7
8
9
10
11
12
13
|
# File 'app/controllers/spree/api/countries_controller.rb', line 7
def index
@countries = Country.ransack(params[:q]).result.
includes(:states).order('name ASC').
page(params[:page]).per(params[:per_page])
respond_with(@countries)
end
|
#show ⇒ Object
15
16
17
18
|
# File 'app/controllers/spree/api/countries_controller.rb', line 15
def show
@country = Country.find(params[:id])
respond_with(@country)
end
|