Class: Comable::Admin::ShipmentMethodsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 16

def create
  if @shipment_method.update_attributes(shipment_method_params)
    redirect_to comable.admin_shipment_method_path(@shipment_method), notice: Comable.t('successful')
  else
    flash.now[:alert] = Comable.t('failure')
    render :new
  end
end

#destroyObject



34
35
36
37
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 34

def destroy
  @shipment_method.destroy
  redirect_to comable.admin_shipment_methods_path, notice: Comable.t('successful')
end

#indexObject



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

def index
  @shipment_methods = @shipment_methods.page(params[:page])
end

#showObject



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

def show
  render :edit
end

#updateObject



25
26
27
28
29
30
31
32
# File 'app/controllers/comable/admin/shipment_methods_controller.rb', line 25

def update
  if @shipment_method.update_attributes(shipment_method_params)
    redirect_to comable.admin_shipment_method_path(@shipment_method), notice: Comable.t('successful')
  else
    flash.now[:alert] = Comable.t('failure')
    render :edit
  end
end