# redirect but without change the address

**URL:** <https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551>\
**Category:** rubyonrails-talk\
**Created:** [February 27, 2008, 10:03pm UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551 "2008-02-27T22:03:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 27, 2008, 10:03pm UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551/1 "2008-02-27T22:03:06Z")

</div>

I want redirect to another controller but without change the address in the address bar of browser.

Then is possible to render a page from another controller? Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_James](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mark\_James](https://discuss.rubyonrails.org/u/Mark_James)\
**Post date:** [February 27, 2008, 11:30pm UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551/2 "2008-02-27T23:30:01Z")

</div>

Luca Roma wrote:

> I want redirect to another controller but without change the address in the address bar of browser.
> 
> Then is possible to render a page from another controller?

If you move the method you wish to call into a controller that is a parent of both controllers you can just call that method from the requested method. Add a render(:template) call to the destination method to ensure that the right view is rendered.

If you don't need to call the other controller's action, just add the render(:template) call to the requested action when you want to "redirect".

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 28, 2008, 8:22am UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551/3 "2008-02-28T08:22:59Z")

</div>

mmm and how i can to passing an id to template?

ex. i want to render "controller/action/10"

Thanks for the responce

Mark Reginald James wrote:

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 28, 2008, 11:07am UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551/4 "2008-02-28T11:07:04Z")

</div>

Must i to use render\_component?

---

<div class="post-metadata">

**Author:** ![Mark\_James](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mark\_James](https://discuss.rubyonrails.org/u/Mark_James)\
**Post date:** [February 28, 2008, 11:33am UTC](https://discuss.rubyonrails.org/t/redirect-but-without-change-the-address/25551/5 "2008-02-28T11:33:28Z")

</div>

Luca Roma wrote:

> mmm and how i can to passing an id to template?
> 
> ex. i want to render "controller/action/10"

There are several ways to pass parameters between actions during one request: controller instance variables, writing to the params hash, method parameters (use defaults to ensure it works with no arguments), and flash.now.
