I went through a stretch where I was constantly experiencing debilitating leg cramps on the trail or shortly after I finished a ride. Usually hit me in my inner quads and they were brutally painful. I tried a sugar and salt solution in my Camelback, pickle juice before a ride, electrolyte tablets and I experimented with all manner of different foods before riding. The only thing that worked for me was fitness. As I began riding more frequently and got in better shape the cramps went away. I was riding 7-8 very technical miles and getting horrible cramps and feeling completely exhausted when done. Now I’m riding twice that mileage with no cramps and feeling great at the end of the ride.