Hai,, I am totally new to Ajax. I am trying to use ajax in my project. Its working fine, I am getting problem while session time expires. If session expires means i am redirecting to login page.Onclick i am calling on ajax function. It will goto controller and it will check the session if session expires then it has to goto login page. On ajax call i am updating the div. If session expires means its calling the login page, but it updating that div. Regards Selvaraj -- 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 -~----------~----~----~----~------~----~------~--~---
any idea??? selva wrote:> Hai,, > > I am totally new to Ajax. I am trying to use ajax in my project. Its > working fine, I am getting problem while session time expires. If > session expires means i am redirecting to login page.Onclick i am > calling on ajax function. It will goto controller and it will check the > session if session expires then it has to goto login page. > > On ajax call i am updating the div. If session expires means its > calling the login page, but it updating that div. > > Regards > Selvaraj-- 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 -~----------~----~----~----~------~----~------~--~---
selva wrote:> Hai,, > > I am totally new to Ajax. I am trying to use ajax in my project. Its > working fine, I am getting problem while session time expires. If > session expires means i am redirecting to login page.Onclick i am > calling on ajax function. It will goto controller and it will check the > session if session expires then it has to goto login page. >Your "session_expired" filter should check if this is an xhr request, if yes a redirection is needed you''ll have to send back javascript redirection snippet: return unless session expired? flash[:notice] = "Your session expired" if request.xhr? render :update do |page| page.redirect_to login_path end else redirect_to login_path end false best, zsombor -- Company - http://primalgrasp.com Thoughts - http://deezsombor.blogspot.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 -~----------~----~----~----~------~----~------~--~---