I use Invisa grip-a rubbery plastic type grip. You get a oarge roll and can cut it to the size you need. It strethes and sticks to the back of the ruler to prevent sliding. A little goes a long way.
I use Invisa-grip- a rubbery type plastic that come in a roll so you cut just the amount you need. I is easy to pull off if you don't want it on any more. A little goes a long way and can stretch to fit the ruler.