

Use lambdas for Rails 3 Route Constraints - renaebair
http://intridea.com/2011/2/21/use-lambdas-for-rails3-route-constraints

======
loginx
That's pretty neat, but doesn't it make more sense to use before_filter in
your controller for that stuff so that you can properly handle errors instead
of showing a 404?

~~~
siong1987
I don't think that the op will want to show a 404 page. If a user is logged
in, I will redirect the user to the homepage. Why let the user accesses the
login page if the user has already logged in?

I guess that is what the op trying to do.

~~~
joe_the_user
So they can log in as a different user?

So they can use the back arrow and go to the page they at before login
redirected them?

I found Drupal's hiding of the login page once I was logged to be truly
annoying on a site I regularly visited (till it was apparently changed
recently).

