# Rendering partial from different controller doesn't cascade?

**URL:** <https://www.ruby-forum.com/t/rendering-partial-from-different-controller-doesnt-cascade/112035>\
**Category:** Rails\
**Created:** [August 14, 2007, 3:12pm UTC](https://www.ruby-forum.com/t/rendering-partial-from-different-controller-doesnt-cascade/112035 "2007-08-14T15:12:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 14, 2007, 3:12pm UTC](https://www.ruby-forum.com/t/rendering-partial-from-different-controller-doesnt-cascade/112035/1 "2007-08-14T15:12:05Z")

</div>

Hi all,

I’m trying to render a partial from a different controller, sparked  
from an update\_html in an AJAX rjs response. The code calls it this  
way:

page[“menu\_#{menu.name}”].replace\_html(:partial =\> “visitor/  
menu”, :object =\> menu)

This is being done since the action being called in this rjs is part  
of a different controller to the visitor controller, where the page  
was rendered from.

The problem is, the visitor controller’s menu partial then renders  
other partials from the visitor controller itself. Of course, in  
there, I don’t specify the controller (DRY?), but the result is that  
being called from the admin controller, it thinks the partial should  
be in the admin controller again.

Thus the visitor/menu partial attempts to render the submenu partial,  
ends up looking for admin/\_submenu and fails!

I don’t want to specify the controller explicitly in all my visitor  
partials, but otherwise the controller doesn’t “cascade”. Is there any  
better alternative?

Thanks!  
Arlen.
