translated a memory game app written in js and jquery into a rails app