First of all, controller methods can't be called directly inside views, instead you need to use helper methods, however Rails still can help you DRY your code and declare a method in controller to to be a helper method that can be used in helpers and views. You can do that by adding this line in the body of Tasks controller:
helper_method :count
Then inside your view you can just do
<%=count%>
Btw you can redefine the count method as follows:
def count
current_user.tasks.count
end
However I don't find a reason why you want to define a method for this in the controller. Were you I would call this directly in the view:
<%=current_user.tasks.count%>