Class: Spree::Api::StatesController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::StatesController
- Defined in:
- app/controllers/spree/api/states_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 |
# File 'app/controllers/spree/api/states_controller.rb', line 8 def index @states = scope.ransack(params[:q]).result. includes(:country).order('name ASC') if params[:page] || params[:per_page] @states = paginate(@states) end respond_with(@states) end |
#show ⇒ Object
19 20 21 22 |
# File 'app/controllers/spree/api/states_controller.rb', line 19 def show @state = scope.find(params[:id]) respond_with(@state) end |