Nope, you can't use pure ruby to do this. Ruby on Rails
is a server side language, and for this kind of job, you can't use it, you should definitely use Javascript
.
Using Jquery
for instance, assuming your radio field got the radio
class, and you wish it to get the newclass
class on clicked:
$("input[type='radio']").click(function() {
$(this).addClass('newclass');
});