Why doesn't redirect_to handle rjs?

Is there a good reason why redirect_to doesn’t check responds_to, so
it can handle redirects in rjs calls? I’ve done something like this
in my app controller, seems to work ok…

alias_method :redirect_to_orig, :redirect_to;
def redirect_to(options = {}, *parameters_for_method_reference)
respond_to do |accepts|
accepts.html do
redirect_to_orig options, parameters_for_method_reference
end
accepts.js do
render :update do |page|
page.redirect_to options
end
end
end
end

Am I doing something broken there, or shall I submit a patch?

Hi Jonathan,

Did you ever figure this out? I’m having what looks to me like a
related
problem.

Thanks,
Bill

----- Original Message -----
From: “Jonathan del Strother” [email protected]
To: [email protected]
Sent: Thursday, August 03, 2006 2:02 PM
Subject: [Rails] Why doesn’t redirect_to handle rjs?