Class: Spree::Api::ReturnAuthorizationsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Spree::Api::ReturnAuthorizationsController
- Defined in:
- app/controllers/spree/api/return_authorizations_controller.rb
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
- #cancel ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#cancel ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 58 def cancel = @order..accessible_by(current_ability, :update).find(params[:id]) if .cancel respond_with , default_template: :show else invalid_resource!() end end |
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 9 def create :create, ReturnAuthorization = @order..build() if .save respond_with(, status: 201, default_template: :show) else invalid_resource!() end end |
#destroy ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 19 def destroy = @order..accessible_by(current_ability, :destroy).find(params[:id]) .destroy respond_with(, status: 204) end |
#index ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 25 def index :admin, ReturnAuthorization = @order. . accessible_by(current_ability, :read). ransack(params[:q]). result = paginate() respond_with() end |
#new ⇒ Object
39 40 41 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 39 def new :admin, ReturnAuthorization end |
#show ⇒ Object
43 44 45 46 47 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 43 def show :admin, ReturnAuthorization = @order..accessible_by(current_ability, :read).find(params[:id]) respond_with() end |
#update ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'app/controllers/spree/api/return_authorizations_controller.rb', line 49 def update = @order..accessible_by(current_ability, :update).find(params[:id]) if .update_attributes() respond_with(, default_template: :show) else invalid_resource!() end end |