If you asked me to label the pictures, I'd say "A ruler with a ribbon."
The "with" in "ruler with a ribbon" implies that if you take the ruler, the ribbon comes with it. "On" only implies proximity, but does not imply attachment. (But as @jcmp26 mentions, when a key is "on" a keyring, it's understood to be attached)
I might say, "A ribbon on a ruler," but that doesn't definitively imply that the ribbon is attached. However, ribbons are normally attached to something.
As an example, if I talk about a sticker on a ruler, my assumption is that the sticker is stuck on the ruler: if I take the ruler, the sticker will be stuck to it, and I get the sticker with the ruler.
As another example: If someone is trying to sell me a ruler, and tells me there's a heavy box on it, with little other context, I'm probably going to think there's a box sitting on top of the ruler, and that they'll have to move the box before they can get to the ruler.
On the other hand, if they say that there's a box with the ruler, I'm going to think that either the ruler comes in a box, or that they'll give me a box when they give me the ruler, and that the box is related to the ruler in function (e.g. there is an instruction manual inside the box, the box is a carrying case, etc.), or maybe it's a combo deal, and I get a free cardboard box when I buy the ruler.
To confuse things further, if I tell someone there's a box on the paper form, they're likely to think of a rectangle drawn on a piece of paper that is to be written on, before they consider a cardboard box resting on top of a sheet of paper.
Lastly, saying that there's "a ruler on a ribbon" more strongly implies something like a ruler drawn onto a ribbon, like this ribbon ruler, rather than a ruler sitting on top of a ribbon.
So there is a subtle interplay with prepositions, and everyone has an opinion on them.