Toe nail injury -- nail attached, but nail bed exposed. What's the best treatment?

Bandaid and topical. The best treatment would be to get the wound assessed by a doctor. With that said if the there are no lacerations in the nail bed and the rest of the nail is attached firmly, no treatment would be necessary except for maybe a bandaid with topical antibiotic cream for a few days. If the nail is loose it may need to be taken off by a doctor or it may fall off on its own soon.
See a foot doc. It is unclear if there is a tear in the nail bed from the history...You should see a foot doc as you may need antibiotics (oral).
Nail issue. Any triple antibiotic ointment with bandaid should suffice. If hint of infection, get it looked at.