I have a partial, it’s a shopping cart display, it’s designed to appear
on several different pages of my site.
One of the buttons on the shopping cart empties the cart, and then I
want the calling page to redisplay.
In other words, the cart controller needs to return the visitor to the
same page – however since the cart could appear on any given page, this
has to be dynamic, not hard-coded.
So the solution I’m considering is to use params[:controller],
params[:action], and params[:id] as a unique identifier of the calling
page. I’m assuming this will work but I want to be sensitized to any
‘gotchas’ before I code this.
If anyone can suggest a better practice I’d appreciate it, thanks.