johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-16 14:25 UTC
Find controller in Request
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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> 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.params[:controller] should be one way to access that datum. - donald --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---