Forum: Ruby on Rails no referer defined in TestRequest

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.
Ede5ca2f61280a8bb5adc31bbd828ab7?d=identicon&s=25 Khaled Hassounah (Guest)
on 2007-06-06 02:21
(Received via mailing list)
in my controller I do the following after login:

    redirect_to  request.referer) || '/'

which works well until I test it, then the dwarfs complain that there
is no referer defined. I did the following and it worked:

    redirect_to (defined?(request.referer) && request.referer) || '/'

It seems like there is no referer (nil or otherwise) defined for
TestRequest. the curious thing though is that I'm the only who seems
to have seem this problem. did everyone silently work around this...
This topic is locked and can not be replied to.