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