I’m having trouble understanding the question, so I suspect maybe others
are and that’s why you haven’t gotten an answer.
What code are you using to call your remote method? remote_function ?
remote_function normally points to a controller, right? You want it to
point to a controller that’s in an other-than-default view? Just tell it
that:
remote_function(:update => ‘div_name’, :url => { :controller =>
:some_other, :action => :my_action, :id => maybe_an_id })
But I don’t think that’s your problem. I think you’re finding your
controller okay, but then you want this action to return a view from
another controller? Okay, that’s easy too:
def some_controller
Maybe there’s some logic here, then
render( :template=> ‘another_controller/view_template_name’ )
end
Okay,but I don’t think that’s what you want either? Maybe if you respond
to this explaining how I got it wrong, someone will be able to figure
out what you need.
Also, you may be interested in the section on “Rendering inline
JavaScriptGenerator page updates” in the ActionController::Base#render
documetnation
(ActionController::Base)
for an alternative to using rjs templates—you can put your rjs-type
code directly in the controller. In which case, if you want an action in
one controller to just render the exact same thing as an action in
another controller would, I think this might work:
def some_controller
render(:controller=>“other_controller”, :action=>“some_action”)
end
Hope that gives you some ideas. I’m trying to build up some karma so
maybe I’ll get lucky and someone will answer my unanswered questions. 
Jonathan
Dave S. wrote:
I asked this last week but nobody answered. Surely in the age of AJAX
someone knows how to do this…
Let’s say I have a Foo object, and the Foo object has Comment objects
associated with it:
- I have a Foo controller, with a view displaying information about the
Foo (including comments).
- I have a CommentsAjaxController that contains all of the remote
methods for dealing with Comments
If the Foo page has a form that allows a comment to be added and invokes
CommentsAjaxController#add_comment, how can I get that remote method to
render views/foo/add_comment.rjs? Or–in the general case–how can I
get the view conventions to work the way they always do, but to have it
look for the correct view belonging to an originating controller rather
than the invoked controller?