Class: Smerp::Quotation::Engine::QuotationProductsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/smerp/quotation/engine/quotation_products_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /quotation_products



24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 24

def create
  @quotation_product = QuotationProduct.new(quotation_product_params)

  if @quotation_product.save
    #redirect_to @quotation_product, notice: "Quotation product was successfully created."
    redirect_to quotation_products_path, notice: "Quotation product was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /quotation_products/1



45
46
47
48
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 45

def destroy
  @quotation_product.destroy
  redirect_to quotation_products_url, notice: "Quotation product was successfully destroyed."
end

#editObject

GET /quotation_products/1/edit



20
21
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 20

def edit
end

#indexObject

GET /quotation_products



6
7
8
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 6

def index
  @quotation_products = QuotationProduct.all
end

#newObject

GET /quotation_products/new



15
16
17
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 15

def new
  @quotation_product = QuotationProduct.new
end

#showObject

GET /quotation_products/1



11
12
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /quotation_products/1



36
37
38
39
40
41
42
# File 'app/controllers/smerp/quotation/engine/quotation_products_controller.rb', line 36

def update
  if @quotation_product.update(quotation_product_params)
    redirect_to @quotation_product, notice: "Quotation product was successfully updated."
  else
    render :edit, status: :unprocessable_entity
  end
end