ruby on rails vs javascript