One hour before going to gym supply your body with sufficient carbs.You can have cornflakes,Idli's,toasts or biscuits.One can also have banana as it provides complex carbohydrates.It takes time to get digested but provide you enough energy.Also take a glass of water which helps you to be hydrated.Never go to gym empty stomach as it will lead to hypoglycemia(low blood sugar)