We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am having a bit of a problem with acts_as_shopping_cart.
After writing:
<%= button_to 'Button', @shopping_cart.clear %>
It spits out the error saying:
Nil location provided. Can't build URI.
The text was updated successfully, but these errors were encountered:
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:
@shopping_cart.clear
<%= 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
Sorry, something went wrong.
No branches or pull requests
I am having a bit of a problem with acts_as_shopping_cart.
After writing:
It spits out the error saying:
The text was updated successfully, but these errors were encountered: