diff --git a/app/controllers/carts_controller.rb b/app/controllers/carts_controller.rb index 36a3270..db68290 100644 --- a/app/controllers/carts_controller.rb +++ b/app/controllers/carts_controller.rb @@ -59,7 +59,7 @@ class CartsController < ApplicationController @cart.destroy if @cart.id == session[:cart_id] session[:cart_id] = nil respond_to do |format| - format.html { redirect_to store_index_url, notice: 'Your cart is currently empty.' } + format.html { redirect_to store_index_url } format.json { head :no_content } end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..fcdebb4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,8 @@ module ApplicationHelper + def hidden_div_if(condition, attributes = {}, &block) + if condition + attributes["style"] = "display: none" + end + content_tag("div", attributes, &block) + end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index efdb61c..cf005e7 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -15,11 +15,11 @@