I have the following piece of code
#some additional code
#that should only execute
#if user is logged in
If you return false from a before_filter, then execution of the request will immediately stop.
If you just make your login_required method return false (or redirect) if they aren't logged in, and make it return true if they are, then just
before_filter :login_required, it should work perfectly.
Edit: As Lenry states below, this will not work in Rails 2.0.1+
Instead, to stop the request use [code]
head :ok in your code