Class: OrdersManagementModule::OrderAdjustmentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/orders_management_module/order_adjustments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /order_adjustments



24
25
26
27
28
29
30
31
32
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 24

def create
  @order_adjustment = OrderAdjustment.new(order_adjustment_params)

  if @order_adjustment.save
    redirect_to @order_adjustment, notice: "Order adjustment was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /order_adjustments/1



44
45
46
47
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 44

def destroy
  @order_adjustment.destroy!
  redirect_to order_adjustments_url, notice: "Order adjustment was successfully destroyed.", status: :see_other
end

#editObject

GET /order_adjustments/1/edit



20
21
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 20

def edit
end

#indexObject

GET /order_adjustments



6
7
8
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 6

def index
  @order_adjustments = OrderAdjustment.all
end

#newObject

GET /order_adjustments/new



15
16
17
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 15

def new
  @order_adjustment = OrderAdjustment.new
end

#showObject

GET /order_adjustments/1



11
12
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /order_adjustments/1



35
36
37
38
39
40
41
# File 'app/controllers/orders_management_module/order_adjustments_controller.rb', line 35

def update
  if @order_adjustment.update(order_adjustment_params)
    redirect_to @order_adjustment, notice: "Order adjustment was successfully updated.", status: :see_other
  else
    render :edit, status: :unprocessable_entity
  end
end