Closed muhammadn closed 10 years ago
Hey @muhammadn
This is not how you would use this.
@shopping_cart.clear
is code you would use in a controller action. Your code needs to look something like this:
<%= button_to 'Button', shopping_cart_path, method: :delete %>
Assuming you specified a route for the delete action on the shopping cart. Then, on that action do something like:
class ShoppingCartController < ApplicationController
def delete
@shopping_cart.clear
end
end
I am having a bit of a problem with acts_as_shopping_cart.
After writing:
It spits out the error saying: