I take mine apart and just wash it. An old toothbrush helps get the soap out of the corner buts.
I used one of those the first time I grated soap and it all got clogged up in the middle of the cylinder. Switched to a box grater and been much happier. YMMV.
Either way, just stuck them into the dishwasher, its just soap after all.
One tip I learned about grating the soap is to put the soap in the freezer for a few minutes so it'll be hard enough that it won't clog the grater. Haven't actually grated any soap so not sure how good the tip is but it seems to make sense.