moved this from ApplicationController to ApplicationHelper so that it would be available in the devise views (which have a different controller)