Here a couple of British cycling guides regarding nutrition for cycling (whilst riding)
1. Eating for long rides
Whether it is a gruelling sportive or a long training ride, optimal nutrition, along with consistent training and realistic pacing, is one of the key requisites for success. Get it wrong, too little or too much, and you may come to a halt, reduce training benefits and significantly increase the time you will need to recover from the ride.
Whether you are on a long training ride, taking part in your main target event for the year or enjoying some winter sun on a training camp, digestive or GI (gastrointestinal) distress can rapidly turn pleasure into misery, end your event or consign you to your hotel room. Your digestive system is how you convert food into useable fuel for your cycling engine so, if it isn’t functioning optimally, your performance will suffer.