I did a bit of grinding before the gym and it made the whole thing a cake walk. basically get around 4 pokemon a few levels higher than the gym pokemon.
thats cool, thats how I used to do it when i play this type of game