Hiya, I am trying to create a login system that once a user clicks login needs to change the layout, then the RJS will replace various divs, but the RJS seems to render before the layout change so it can''t find the divs. I''m sure I''m missing something simple! Any help would be fantastic :D Bex -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You need a layout change? Just post to a new page altogether and forget the RJS. Jason On 11/15/06, Becky Franklin <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hiya, > > I am trying to create a login system that once a user clicks login needs > to change the layout, then the RJS will replace various divs, but the > RJS seems to render before the layout change so it can''t find the divs. > I''m sure I''m missing something simple! > > Any help would be fantastic :D > Bex > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Becky Franklin wrote:> Hiya, > > I am trying to create a login system that once a user clicks login needs > to change the layout, then the RJS will replace various divs, but the > RJS seems to render before the layout change so it can''t find the divs. > I''m sure I''m missing something simple! > > Any help would be fantastic :D > BexRJS shouldn''t care about a layout at all. I have a widget in my app that upadte the shopping cart element which is in the layout and it works fine. If you want to change a div via RJS it will work that same way whether the div is in the template or the layout since its all just divs to the browser itself, and the browser is what executes the javascript. The only reason I can see a problem with this is if you are relying on the layout to create variable which you use in the RJS template. This is a bad idea since you shouldn''t be assigning variables in your view at all, and the layout will never be executed when rendering RJS at all. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---