I did a 58 mile ride yesterday with a decent amount of climbing. I had a Kind bar at the halfway point, but nothing else, and about halfway back home from there felt myself dragging. I also had hit a head wind, so it was a combination of not enough food and wind. Even out of the wind I found that I couldn't get going again.
When I did the NYC Century a few months back there was food every 15 miles or so and on that ride I was still going strong at 100 miles, even surprising myself.
I'll be climbing Mt. Haleakala in a few months and my biggest concern will be food. It's 10000' of climbing over 35 or so miles, almost entirely uphill. I need to figure out how to carry the food and the extra clothes I'll need.
So the answer is to eat before you get hungry, drink before you get thirsty. As for what, I usually keep a few bars and some gels in my pocket, but on a long ride a PBJ hits the spot. I don't carry sports drink but most of my rides are in urban/suburban areas and I just stop and buy them when I need them.