It seems a bit odd to me but nothing too bad. There could be a hash from radio button to selection listener or even an object encapsulating the two of them. It's just very rare to see direct index handling in Ruby in my experience.