Ditto to the person who said you can get the recipe for oral rehydration fluid online.. it's easy and cheap, consisting of water, a tiny amount of sugar, of salt, and of baking soda (or was it powder? I forget now,) but here it is: http://rehydrate.org/solutions/homemade.htm
I use a pinch of potassium-based Featherweight Baking powder too to good effect.
But leg cramps are caused by a deficiency in the -iums: magnesium, calcium, potassium, and the sugar-salt-water rehydration fluid, or Gatorade, won't help much if at all. Citracal Plus with Magnesium kept the leg cramps away during pregnancy for me, and it is pricey, but cheap foods super-rich in magnesium are spinach, pumpkin and other winter squash seeds, and black beans. For potassium, everyone thinks of bananas, but beans of almost any type, as well as canned tomatoes and tomato sauces/tomato paste, and winter squash beat bananas for potassium, and spinach has a lot, so it's a good source for both.
Calcium, everyone thinks dairy, but my kids have dairy allergy so we have learned better ways to get calcium, including supplements and nondairy foods rich in calcium: turnip greens, broccoli, canned salmon with bones, and sardines in oil.
Also, eating too much protein and sodium causes calcium excretion in the urine, so eating less meat and salt will reduce calcium loss and therefore reduce the amount of supplementation needed.
hth,