One method for controlling your diet when you train is called carb cycling. It's pretty simple. On workout days, you eat a lot of carbohydrates, but lower fat. On non-workout days, you eat very few carbohydrates and more protein and fat.
Here is a good beginner's guide to carb cycling over on T-Nation:
A Beginner's Guide to Carb Cycling - by Matt McGorry
Warning: T-Nation articles are not work/family safe. They have pictures of scantily-clad "fitness models."
That's not the only model for carb cycling. There is the weekend carb-up method (used in the Anabolic Diet by Dr. Mauro Di Pasquale. Or Eric Cressey's Maximum Muscularity diet method. There are other ratios of carbs, fats, and proteins you can use. But the principle is basically sound. Your body requires fats and protein in order to function, but there are no essential carbs. They're useful for maintaining maximum performance capacity, but they also interfere with fat loss and contribute to fat gain. Thus you only provide them when you need them and drop them on days you don't.
This is basically how I eat - low-carb, high-protein and high-fat on non training days. On training days I eat moderate-to-high carb, slightly less protein, and low-to-moderate fat. I don't follow the ratios in that article, but I do follow the idea that you need carbs on your workout days and can skip them on the off days.
Hope that gives you some ideas on how to take control of your training diet.