The best way to rim the glass and have the salt stay on the rim is by using water. Place water on a shallow plate and salt on a separate shallow plate.  Dip the rim of the glass in the water and then in the salt. We find that this works much better than using a lime or lemon wedge or citrus juice.