RJS throwing 'rubycode' exception

names = [“ruby”, “ajax”]
page << “alert(#{
names.to_s})”

I think this should do it:

names = [“ruby”, “ajax”]
page << “alert(’#{names.to_s}’)”

(note the extra quotes in there for the javascript string.)