Class: Smerp::Quotation::Engine::QuotationItemGroupsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /quotation_item_groups



33
34
35
36
37
38
39
40
41
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 33

def create
  @quotation_item_group = QuotationItemGroup.new(quotation_item_group_params)

  if @quotation_item_group.save
    redirect_to @quotation, notice: "Quotation item group was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject

DELETE /quotation_item_groups/1



53
54
55
56
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 53

def destroy
  @quotation_item_group.destroy
  redirect_to @quotation, notice: "Quotation item group was successfully destroyed."
end

#editObject

GET /quotation_item_groups/1/edit



29
30
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 29

def edit
end

#find_quotationObject



6
7
8
9
10
11
12
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 6

def find_quotation
  if params[:quotation_item_group].nil?
    @quotation = Quotation.find(params[:quotation_id])
  else
    @quotation = Quotation.find(params[:quotation_item_group][:quotation_id])
  end
end

#indexObject

GET /quotation_item_groups



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

def index
  @quotation_item_groups = QuotationItemGroup.all
end

#newObject

GET /quotation_item_groups/new



24
25
26
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 24

def new
  @quotation_item_group = QuotationItemGroup.new
end

#showObject

GET /quotation_item_groups/1



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

def show
end

#updateObject

PATCH/PUT /quotation_item_groups/1



44
45
46
47
48
49
50
# File 'app/controllers/smerp/quotation/engine/quotation_item_groups_controller.rb', line 44

def update
  if @quotation_item_group.update(quotation_item_group_params)
    redirect_to @quotation, notice: "Quotation item group was successfully updated."
  else
    render :edit, status: :unprocessable_entity
  end
end