I save packets of silica gel that come with vitamins, electronic equipment, whatever (as long as they’re clean) and use those. There seems to be an endless supply. The little envelopes they come in are meant to be very porous so I can’t think of any reason to not leave the silica gel inside the little packet just the way it is (and in my not-entirely-inexpert opinion, there’s absolutely no chance of anything bad happening regarding contact with batteries) (although don’t forget that zinc-air batteries discharge whether you’re using them or not so I think this question is probably immaterial). Every couple of months I put the little packets in the toaster oven, set on the lowest of the low super-low just-warm setting, for an hour or two or until I remember them and dry them out. I’ve had some of these for years. The screwtop jar or other airtight container is good advice, since you want the silica gel to be absorbing the humidity just from inside the container, and not your whole house.
[edit] And I agree about the rice. I think it’s a bad idea, first because it doesn’t seem to work, and second because although it’s pretty inert it’s still basically food. And the silica gel technique is so very easy…