We bought a bunk bed and installed both of them on the floor. Through extensive kid use, the partial-length side rail worked loose -- twice. I suspect that the bunk ladder would have provided more support. As you might be able to see in the picture, I already tried adding screws, but it wasn't enough.
I found this diy article about a loose side bar, and Ecnerwal's answer, but I don't think the frame of the bed has enough thickness for the bed bolt. At least that's a better idea than my first one, which was a thru-bolt -- there's not enough room on the inside of the bed frame before the mattress.
My latest idea is a metal bracket that would wrap around the vertical post and screw to the frame on either side. I don't have a vise to bend something, though. Are there joist hangers small enough? Would small L brackets be enough?
Updated: I used carriage bolts at @mazura's suggestion, and fender washers on either side of the wood rail, ending in a basic hex nut. Got all the hardware for $2!
Before:
After: