Since you're calling this method in a couple of places, you can put this method in your `ApplicationController` (you could also put it in a helper somewhere else if you want to just make it available to specific controllers).  Just an FYI - I'll merge in as is.