9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/stall/carts_controller.rb', line 9
def update
respond_to do |format|
service = Stall.config.service_for(:cart_update).new(@cart, cart_params)
if service.call
format.html.xhr do
render 'show'
end
format.html.any do
flash[:success] = t('stall.carts.flashes.update.success')
redirect_to cart_path(@cart)
end
else
format.html.xhr do
render 'show'
end
format.html.any do
flash[:error] = t('stall.carts.flashes.update.error')
render 'show'
end
end
end
end
|