after you redirect to cloths_path from ItemController's create action @cart instance variable will not be available to cloth's controller index action. to need to reset it some how in index action
for eg: -
you can pass cart id to it and find it in index cloth's action
redirect_to clothes_path, card_id: @cart.id
and in cloth's index action do
@cart = Cart.find params[:cart_id]
create a mathod in application controller, and after u create a new cart, save its id in session, like
session[:cart] = @cart.id
def current_cart
@cart = Cart.find session[:cart_id]
end
and in view use current_cart method instead of @cart