Class: Comable::Admin::ShipmentMethodsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/comable/admin/shipment_methods_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /admin/shipment_methods



27
28
29
30
31
32
33
34
35
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 27

def create
  @shipment_method = Comable::ShipmentMethod.new(shipment_method_params)

  if @shipment_method.save
    redirect_to comable.admin_shipment_method_url(@shipment_method), notice: 'Shipment method was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /admin/shipment_methods/1



48
49
50
51
52
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 48

def destroy
  @shipment_method = Comable::ShipmentMethod.find(params[:id])
  @shipment_method.destroy
  redirect_to comable.admin_shipment_methods_url, notice: 'Shipment method was successfully destroyed.'
end

#editObject

GET /admin/shipment_methods/1/edit



22
23
24
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 22

def edit
  @shipment_method = Comable::ShipmentMethod.find(params[:id])
end

#indexObject

GET /admin/shipment_methods



7
8
9
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 7

def index
  @shipment_methods = Comable::ShipmentMethod.all
end

#newObject

GET /admin/shipment_methods/new



17
18
19
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 17

def new
  @shipment_method = Comable::ShipmentMethod.new
end

#showObject

GET /admin/shipment_methods/1



12
13
14
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 12

def show
  @shipment_method = Comable::ShipmentMethod.find(params[:id])
end

#updateObject

PATCH/PUT /admin/shipment_methods/1



38
39
40
41
42
43
44
45
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 38

def update
  @shipment_method = Comable::ShipmentMethod.find(params[:id])
  if @shipment_method.update(shipment_method_params)
    redirect_to comable.admin_shipment_method_url(@shipment_method), notice: 'Shipment method was successfully updated.'
  else
    render :edit
  end
end