WIP: ProxyOrders don't require an order, adding an edit path for proxy orders

initialises an order if one does not exist and redirects to its edit path
This commit is contained in:
Rob Harrington
2016-12-12 11:33:49 +11:00
parent 4b440c83a4
commit 3d3013a592
4 changed files with 10 additions and 5 deletions

View File

@@ -2,6 +2,11 @@ module Admin
class ProxyOrdersController < ResourceController
respond_to :json
def edit
@proxy_order.initialise_order! unless @proxy_order.order
redirect_to spree.edit_admin_order_path(@proxy_order.order)
end
def cancel
if @proxy_order.cancel
respond_with(@proxy_order) do |format|