Return to previous page

You can easily make a back button like this:

<%= button_to "Back", :back %>

button_to will pass the second argument (:back) on to url_for, and as
you can see in the documentation (http://api.rubyonrails.org/classes/
ActionView/Helpers/UrlHelper.html#M001564), :back will be translated
to request.env["HTTP_REFERER"] or javascript:history.back() if referer
is blank. That's it!