There are a couple of options for locking a ramp in the bed of a pickup truck:
When I had 8' ramps and a truck with an 8' bed, I'd store the ramps on top of the wheel arches. The front of the ramps were held in place with a bungie cord and the rear was secured to a
stake pocket anchor using a
long-shackle padlock.
If you want to store the ramp on the floor of the bed, you can run a cable through it and then padlock the cable to the stake pocket anchor.
In both of these cases it's better to use an anchor that has to be unscrewed by turning the anchor ring. In my experience, these anchors don't hold as well as some
other anchors but they also can't be removed by loosening a few screws.
MasterLock also makes a pretty nice
truck bed U-lock that will mount in a stake pocket or replace one of the factory-mounted tie-down hooks that you might already have in the bed of your truck. This is what I'm currently using and it's
much more secure than a standard stake pocket anchor. Not that I ever had anything stolen while using standard anchors...