small medium large xlarge

23 Aug 2008, 12:42
Michael Tobola (2 posts)

So far I am up to the end of “C4: Finishing the Cart.” Everything so far has gone pretty well and I have understood most everything up to this point. When it came time for me to actually add something as simple as a back button though I am totally at a loss. All I am trying to do is add a back button to the cart page like almost every normal cart has. I have tried looking over the API regarding the @button_to@ and @link_to@ methods to no avail. I also looked at the one example of a back button in use in the depot app and couldn’t get it to work with the cart. Do I have to specify the path explicity? That doesnt seem right to me. Thanks for any help.

23 Aug 2008, 15:14
Sam Ruby (633 posts)

Most browsers have a back button, and most carts specify a path explicitly on “back” links (with Rails you would use one of the helper function to do this, like url_for).

But if you want to provide a back button based on where the user came from, take a peek ahead at iteration F3. There you will find a sidebar named “A Friendlier Login System”, which appears on page 173 in B1.5.

Be forewarned that while all popular browsers by default provide this information, you may occasionally encounter requests that do not. For this reason, it is important to provide a default.

You must be logged in to comment