# Returning to a view after completing an action

**URL:** <https://www.ruby-forum.com/t/returning-to-a-view-after-completing-an-action/87170>\
**Category:** Rails\
**Created:** [February 28, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/returning-to-a-view-after-completing-an-action/87170 "2007-02-28T18:17:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![macarthy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@macarthy](https://www.ruby-forum.com/u/macarthy)\
**Post date:** [February 28, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/returning-to-a-view-after-completing-an-action/87170/1 "2007-02-28T18:17:27Z")

</div>

Newbie question

Hi there I have links that goes to my edit address form in several  
views. Does RoR have any clever helpers/ways to return my user to the  
originating view when they have finished with the edit form ??? or do  
need to roll my own

Thanks

---

<div class="post-metadata">

**Author:** ![macarthy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@macarthy](https://www.ruby-forum.com/u/macarthy)\
**Post date:** [February 28, 2007, 7:49pm UTC](https://www.ruby-forum.com/t/returning-to-a-view-after-completing-an-action/87170/2 "2007-02-28T19:49:46Z")

</div>

try

redirect\_to :back

upon a successful save

---

<div class="post-metadata">

**Author:** ![macarthy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@macarthy](https://www.ruby-forum.com/u/macarthy)\
**Post date:** [March 2, 2007, 1:27am UTC](https://www.ruby-forum.com/t/returning-to-a-view-after-completing-an-action/87170/3 "2007-03-02T01:27:14Z")

</div>

Hi Justin,

macarthy wrote:

> Does RoR have any clever helpers/ways to return my user to the  
> originating view when they have finished with the edit form ???

redirect\_to :back

From the doc on the redirect\_to method at [api.rubyforge.org](http://api.rubyforge.org)  
🔙 Back to the page that issued the request. Useful for forms that  
are  
triggered from multiple places. Short-hand for  
redirect\_to(request.env[“HTTP\_REFERER”])

hth,  
Bill
