# Replace\_html other controller

**URL:** <https://www.ruby-forum.com/t/replace-html-other-controller/92066>\
**Category:** Rails\
**Created:** [April 15, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/replace-html-other-controller/92066 "2007-04-15T17:17:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfingerh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@cfingerh](https://www.ruby-forum.com/u/cfingerh)\
**Post date:** [April 15, 2007, 5:17pm UTC](https://www.ruby-forum.com/t/replace-html-other-controller/92066/1 "2007-04-15T17:17:05Z")

</div>

I’m using the replace\_html for updating a div element.  
How can I update it with an action from other controller?  
I’m looking for something like this

```
         page.replace_html 'div1', :controller=>

```

‘users’ ,:action=\>‘list’

thanks

Christian

---

<div class="post-metadata">

**Author:** ![cfingerh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@cfingerh](https://www.ruby-forum.com/u/cfingerh)\
**Post date:** [April 15, 2007, 6:28pm UTC](https://www.ruby-forum.com/t/replace-html-other-controller/92066/2 "2007-04-15T18:28:35Z")

</div>

Hi Christian,

> I’m using the replace\_html for updating a div element.  
> How can I update it with an action from other controller?  
> I’m looking for something like this
> 
> page.replace\_html ‘div1’, :controller=\>  
> ‘users’ ,:action=\>‘list’

I assume there’s some reason you’re not just invoking the list method in  
the  
user controller directly, but given that you’re not, you’ll need to  
redirect\_to that method using page.redirect\_to … Then in the rjs  
template  
for that method you can do the page.replace\_html.

hth,  
Bill
