celtic-hmwrWBYl3WAdnm+yROfE0A@public.gmane.org
2007-Aug-14 13:11 UTC
rendering partial from different controller doesn''t cascade?
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---