Forum: Ruby on Rails Find controller in Request

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.
446405a3ff8659683e0f4671e0d211da?d=identicon&s=25 johnmcauley@gmail.com (Guest)
on 2007-04-16 16:26
(Received via mailing list)
Hello all,

I have a get request, say www.superduper.com/football/list, which
lists all footballs belonging to the company superduper.  However,  in
the application controller, I want to create a filter which checks to
see if there are any footballs in the database first and if not,
forwards to a different URL.

Something like

if(request.url.controller == 'football')
redirect_to 'some URL'

I have been looking around for this and cant find it.

Cheers,
John
E1f43bafda26307a050d11902752b2a6?d=identicon&s=25 Ball, Donald A Jr (Library) (Guest)
on 2007-04-16 17:58
(Received via mailing list)
>
> I have been looking around for this and cant find it.

params[:controller] should be one way to access that datum.

- donald
This topic is locked and can not be replied to.