I'm looking for a way to DRY up some of my controller code.
I'm having problems with code that keeps coming back where I have to check
some very similar context dependant conditions. It can't be moved into a
filter because then it depends on a session variable, then on a
So I was wondering: is there some way to make context based filters? Or
should I just make a method that gets called with the proper parameters.
But is redirect_to safe enough then? Does it stop the control flow in the
I would have something like this in the controller
redirect_to # the page for the bad situations
# now do stuff in a check environment