Class: OrdersManagementModule::PurchaseOrderLineItemsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/orders_management_module/purchase_order_line_items_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /purchase_order_line_items



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

def create
  @purchase_order_line_item = PurchaseOrderLineItem.new(purchase_order_line_item_params)

  if @purchase_order_line_item.save
    redirect_to @purchase_order_line_item, notice: "Purchase order line item was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /purchase_order_line_items/1



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

def destroy
  @purchase_order_line_item.destroy!
  redirect_to purchase_order_line_items_url, notice: "Purchase order line item was successfully destroyed.", status: :see_other
end

#editObject

GET /purchase_order_line_items/1/edit



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

def edit
end

#indexObject

GET /purchase_order_line_items



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

def index
  @purchase_order_line_items = PurchaseOrderLineItem.all
end

#newObject

GET /purchase_order_line_items/new



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

def new
  @purchase_order_line_item = PurchaseOrderLineItem.new
end

#showObject

GET /purchase_order_line_items/1



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

def show
end

#updateObject

PATCH/PUT /purchase_order_line_items/1



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

def update
  if @purchase_order_line_item.update(purchase_order_line_item_params)
    redirect_to @purchase_order_line_item, notice: "Purchase order line item was successfully updated.", status: :see_other
  else
    render :edit, status: :unprocessable_entity
  end
end