Ccombined webapp ruby and javascript code