module ApplicationHelper def cancel_link return link_to 'Cancel', request.env["HTTP_REFERER"], :confirm => 'Are you sure? Any changes will be lost.' end end