The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Acts As Authenticated and Ajax

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Maxim Kulkin

Posts: 58
Nickname: hapk
Registered: Sep, 2006

Maxim Kulkin is developer in Selectosa Systems.
Acts As Authenticated and Ajax Posted: Sep 10, 2006 5:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Maxim Kulkin.
Original Post: Acts As Authenticated and Ajax
Feed Title: Software development
Feed URL: http://maximkulkin.blogspot.com/feeds/posts/full?alt=rss
Feed Description: Software development
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Maxim Kulkin
Latest Posts From Software development

Advertisement
I've been using AAA-based authentication system and got problems with session expiry. When session is expired action from protected page should redirect to login page. But this doesn't work right if the action is called by Ajax.

The solution is to do the redirect with RJS if it is Ajax request.

Though I don't plan to handle redirects in Ajax request other then to do them, I've changed ActionController::Base.redirect_to to produce RJS redirect for Ajax requests:


def redirect_to(options = {}, *params)
if request.xhr?
render :update do |page|
page.redirect_to url_for(options, *params)
end
else
super
end
end

Read: Acts As Authenticated and Ajax

Topic: render_tree for Rails Previous Topic   Next Topic Topic: Using introspection to get method arguments and other info

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use