How to work with Database in routes? Rails 3

redhotberry
Fri, 04 Feb 2011 09:23:21 -0000

Hello. How to check presence of object in DB in routes? If object
exists in DB - rais app shows its page, if not - it redirects to 404.
I know that it''s possible to do all this logic in controller but i
would to know how to do it in routes.