You can also buy veggie clips. They are basically the same type clips you use to close a bag of chips but with suction cups to attach to the tank walls. With cucumbers or zuchinni, you can also cut them into strips and "plant" them in the substrate.
What I use is a clothes peg... put the piece of veggie in the end, and then tie a piece of string around it that is attached to something heavy (like a piece of cutlery).
The easiest way I have used to feed vegetables is to spear he veggie with a stainless steel fork and toss the whole thing in the tank. When the fish or snails are done, it is easy to reach in and retrieve the fork.