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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel N
2007-Jul-26 02:04 UTC
Re: how to refresh the entire page from link_to_remote (RJS) ?
On 7/26/07, AD <adingod-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > 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, > ADThat''s because you acutally need the client to request the change of location. This is done with javascript by using the document.locationproperty. 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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Works great, thanks again. On Jul 25, 10:04 pm, "Daniel N" <has....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7/26/07, AD <adin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > 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.locationproperty. > > Rails has a helper for it though. You use it in your RJS template like > > page.redirect_to some_url > > Docs athttp://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper... > > HTH > Daniel--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---