Class: Shoppe::OrdersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Shoppe::OrdersController
- Defined in:
- app/controllers/shoppe/orders_controller.rb
Instance Method Summary collapse
Instance Method Details
#accept ⇒ Object
16 17 18 19 |
# File 'app/controllers/shoppe/orders_controller.rb', line 16 def accept @order.accept!(current_user) redirect_to @order, :notice => "Order has been accepted successfully" end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/shoppe/orders_controller.rb', line 6 def index @query = Shoppe::Order.ordered.received.includes(:order_items => :product).page(params[:page]).search(params[:q]) @orders = @query.result end |
#pay ⇒ Object
31 32 33 34 |
# File 'app/controllers/shoppe/orders_controller.rb', line 31 def pay @order.pay!(params[:payment_reference], 'Manual') redirect_to @order, :notice => "Order has been marked as paid successfully" end |
#reject ⇒ Object
21 22 23 24 |
# File 'app/controllers/shoppe/orders_controller.rb', line 21 def reject @order.reject!(current_user) redirect_to @order, :notice => "Order has been rejected successfully" end |
#search ⇒ Object
11 12 13 14 |
# File 'app/controllers/shoppe/orders_controller.rb', line 11 def search index render :action => "index" end |
#ship ⇒ Object
26 27 28 29 |
# File 'app/controllers/shoppe/orders_controller.rb', line 26 def ship @order.ship!(current_user, params[:consignment_number]) redirect_to @order, :notice => "Order has been shipped successfully" end |