Before filter?

I couldn't get this to work without the below change - guessing it has to do with a rails version (I'm running 4.1.4).