I have this line in my votes controller:
before_filter :authenticate
So when I vote while logged out, it should fail this filter.
M
Since the request that is causing problems is ajax try adding a check within your before_filter to whether the request is js.
if request.xhr? render :text => "document.location = '#{login_path}';", :layout => false else redirect_to login_path, ... end