how to refresh the entire page from link_to_remote (RJS) ?

I have some RJS functionality for user login. If successful I want to refresh the entire page to reflect the new situation, but if I use redirect_to only the target (small) div get replaced with the entire page, not entire page.

Any idea?

Thanks, AD

That’s because you acutally need the client to request the change of location. This is done with javascript by using the document.location property.

Rails has a helper for it though. You use it in your RJS template like

page.redirect_to some_url

Docs at

http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html

HTH

Daniel

Works great, thanks again.