@smt116 I had a lot of problems in running javascript in rails because of Turbolinks.  There are situations ( especially when use link_to to navigate on site) where turbolinks doesn't load js script correctly. One of solutions of this was using this 'page:load' turbolinks event to get it work. I know it isn't perfect and I don't understand it completely but I have lack of knowledge in this subject to get better solution.

http://stackoverflow.com/questions/17600093/rails-javascript-not-loading-after-clicking-through-link-to-helper