I do think this is a simple but when we dont know how, it is not simple
I have got a shopping cart and URL to show it is something like
…/shop/cart/edit, and in the template cart.rhtml, I have some buttons
to increment, decrement, remove items in the cart, accordingly in the
cart controller, I have a method for each button, for instance,
It works! However in the browser, the URL is changed from
…/shop/cart/edit to …/shop/cart/increment/[item id]. Then if I click
on refresh button in the browser, the increment action will be redone,
that’s what I want to prevent. What I want exactly is I would like to
see the URL …/shop/cart/edit unchanged after the buttons are clicked.
I know, I can call redirect_to instead of render, but performance would
not be the same. Any idea and hit are greatly appreciated. Thanks!