Forum: Ruby on Rails login redirect on ajax call?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3b01f080c887672bbfa215d39a2d41f5?d=identicon&s=25 Mark (Guest)
on 2007-06-06 23:17
Hi,

I have a link that uses the link_to_remote helper, however the method it
calls requires the user to log in.

before_filter :login_required

How can I get the method to re-direct the user if they are not logged in
when the Ajax call is made?

Cheers
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-06-06 23:23
(Received via mailing list)
If you're doing RJS, do a page.redirect_to(url).

Jason
This topic is locked and can not be replied to.