JavaScript running on Ruby-on-Rails