Right now I have a login partial that expands so the user can login. After the user logins in I want that partial to go away. What is the recommended way of doing this? -- 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 just need to check to see if they''re logged in. Usually you''ll have something in the session like this: <% unless session[:logged_in] %> <%=render :partial =>"login" %> <% end %> Something along those lines. On 4/10/07, Arch Stanton <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Right now I have a login partial that expands so the user can login. > After the user logins in I want that partial to go away. > > What is the recommended way of doing this? > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Brian Hogan wrote:> You just need to check to see if they''re logged in. Usually you''ll have > something in the session like this: > > <% unless session[:logged_in] %> > <%=render :partial =>"login" %> > <% end %> > > Something along those lines.I didn''t explain right. Go to say http://newsvine.com and try to login. When you select to login, an AJAX style element comes down to allow you to login. After you login, that element goes away. So if I render the partial "login" in the rjs template associated with my login action, how do I remove that template once they click the login button? Do I just redirect them back to the home page? That doesn''t seem elegant as it requires refreshing the entire page. -- 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 -~----------~----~----~----~------~----~------~--~---
Ahhh. your login form would be a form_remote tag. Your controller that logs you in would render an rjs that does a page.remove"login_form_id" or whatever. On 4/10/07, Arch Stanton <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Brian Hogan wrote: > > You just need to check to see if they''re logged in. Usually you''ll have > > something in the session like this: > > > > <% unless session[:logged_in] %> > > <%=render :partial =>"login" %> > > <% end %> > > > > Something along those lines. > > > I didn''t explain right. > > Go to say http://newsvine.com and try to login. When you select to > login, an AJAX style element comes down to allow you to login. After > you login, that element goes away. So if I render the partial "login" > in the rjs template associated with my login action, how do I remove > that template once they click the login button? > > Do I just redirect them back to the home page? That doesn''t seem > elegant as it requires refreshing the entire page. > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Keep in mind also that when you do that, you force users to have JS-enabled browsers. In my opinion, an app should still work if JS is disabled or not available. On 4/10/07, Brian Hogan <bphogan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Ahhh. > your login form would be a form_remote tag. > Your controller that logs you in would render an rjs that does a > page.remove "login_form_id" or whatever. > > > On 4/10/07, Arch Stanton <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > Brian Hogan wrote: > > > You just need to check to see if they''re logged in. Usually you''ll > > have > > > something in the session like this: > > > > > > <% unless session[:logged_in] %> > > > <%=render :partial =>"login" %> > > > <% end %> > > > > > > Something along those lines. > > > > > > I didn''t explain right. > > > > Go to say http://newsvine.com and try to login. When you select to > > login, an AJAX style element comes down to allow you to login. After > > you login, that element goes away. So if I render the partial "login" > > in the rjs template associated with my login action, how do I remove > > that template once they click the login button? > > > > Do I just redirect them back to the home page? That doesn''t seem > > elegant as it requires refreshing the entire page. > > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---