Class: Tienda::DeliveryServicesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tienda/delivery_services_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
# File 'app/controllers/tienda/delivery_services_controller.rb', line 15

def create
  @delivery_service = Tienda::DeliveryService.new(safe_params)
  if @delivery_service.save
    redirect_to :delivery_services, :flash => {:notice => t('tienda.delivery_services.create_notice')}
  else
    render :action => "new"
  end
end

#destroyObject



35
36
37
38
# File 'app/controllers/tienda/delivery_services_controller.rb', line 35

def destroy
  @delivery_service.destroy
  redirect_to :delivery_services, :flash => {:notice =>t('tienda.delivery_services.destroy_notice')}
end

#editObject



24
25
# File 'app/controllers/tienda/delivery_services_controller.rb', line 24

def edit
end

#indexObject



7
8
9
# File 'app/controllers/tienda/delivery_services_controller.rb', line 7

def index
  @delivery_services = Tienda::DeliveryService.all
end

#newObject



11
12
13
# File 'app/controllers/tienda/delivery_services_controller.rb', line 11

def new
  @delivery_service = Tienda::DeliveryService.new
end

#updateObject



27
28
29
30
31
32
33
# File 'app/controllers/tienda/delivery_services_controller.rb', line 27

def update
  if @delivery_service.update(safe_params)
    redirect_to [:edit, @delivery_service], :flash => {:notice => t('tienda.delivery_services.update_notice')}
  else
    render :action => "edit"
  end
end