2-column select lists (Available/Selected)

I’m trying to get one of those 2-column select lists (where there’s an
“Add>>” and a “<<Remove” button between them) working for a Rails
application. First of all, what the heck is this thing called?

You’d list all of the available items in one select list, and the
selected ones in the other.
Items move from one list to the other, but can’t be in both (mutually
exclusive). This would be an alternative to a huge list of

An example:

Has anyone done something like this in Rails yet? The submit would be
tricky as it would need to pass back the id’s that are in the
“selected” list. Also keeping state after an error returns you to the
page might be a little difficult…

I was able to get started with this:


thanks, this looks good, very clean. It’s not super complicated, but I
didn’t want to reinvent the wheel.