I am wanting to establish a before filter in my controller that checks to see if a user is authenticated and redirects them to the login page if they are not. In rails it's quite trivial. Based on how rails works, I would have expected it to be something like this:
class PageController extends ApplicationController { var $before_filter = "_authenticate";
function _authenticate() { do_some_stuff(); } }
No matter what I try, I can't get before filters to work in any fashion. Any tips?
jereme
CommentAuthorbermi
jereme,
I agree with you that
var $before_filter = "_authenticate";
function __construct()
{
$this->beforeFilter('_authenticate');
}