extracted the purchases of month from view to application controller helper_method