It can be done but its kinda a pain sometimes, depending on the coral type. Things like gsps do well glued, leathers and mushrooms and such are trickier. My favorite trick is to put them in a small container of rubble or CC with netting over it, they will attach to a piece of rubble or cc, then you can easily glue that rubble or cc to the rockwork.
1. if you have a dead spot in the sand, you can get the soft coral to sit there for a few days, it will start to grab sand. Then when you pick it up, it's fused to some grains of sand or crushed coral and you can glue it to a rock because the glue sticks to the sand that the coral is grabbed onto.
2. The toothpick method works very well
3. Thread a needle and sew the coral ont whatever you want. Alternately, you can sew some thread around the base and glue the thread to whatever you want.