Class: Spree::Api::CountriesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::CountriesController
- Defined in:
- app/controllers/spree/api/countries_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/spree/api/countries_controller.rb', line 8 def index @countries = Spree::Country. accessible_by(current_ability). ransack(params[:q]). result. order('name ASC') country = Spree::Country.order("updated_at ASC").last if stale?(country) @countries = paginate(@countries) respond_with(@countries) end end |
#show ⇒ Object
23 24 25 26 |
# File 'app/controllers/spree/api/countries_controller.rb', line 23 def show @country = Spree::Country.accessible_by(current_ability, :show).find(params[:id]) respond_with(@country) end |