{"action":"opened","issue":{"url":"https://api.github.com/repos/crismali/magic_lamp/issues/28","labels_url":"https://api.github.com/repos/crismali/magic_lamp/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/crismali/magic_lamp/issues/28/comments","events_url":"https://api.github.com/repos/crismali/magic_lamp/issues/28/events","html_url":"https://github.com/crismali/magic_lamp/issues/28","id":96634744,"number":28,"title":"Inline javascript - method does not exists","user":{"login":"malissa","id":906976,"avatar_url":"https://avatars.githubusercontent.com/u/906976?v=3","gravatar_id":"","url":"https://api.github.com/users/malissa","html_url":"https://github.com/malissa","followers_url":"https://api.github.com/users/malissa/followers","following_url":"https://api.github.com/users/malissa/following{/other_user}","gists_url":"https://api.github.com/users/malissa/gists{/gist_id}","starred_url":"https://api.github.com/users/malissa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malissa/subscriptions","organizations_url":"https://api.github.com/users/malissa/orgs","repos_url":"https://api.github.com/users/malissa/repos","events_url":"https://api.github.com/users/malissa/events{/privacy}","received_events_url":"https://api.github.com/users/malissa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-22T18:33:55Z","updated_at":"2015-07-22T18:33:55Z","closed_at":null,"body":"I'm loading a fixture with a layout that yields a content block :scripts at the bottom. The :scripts content block contains some inline javascript that I set in a partial - something like this:\r\n\r\n```ruby\r\n<% content_for :scripts do %>\r\n<script>\r\n    var goTo = function(path){\r\n        window.location.href = path;\r\n    }\r\n\r\n    $('body').on('click', function(){\r\n        goTo(\"/\");\r\n    });\r\n</script>\r\n<% end %>\r\n```\r\n\r\nThis works great in my app but when I run my tests the goTo function does not exist, however, the functions in application.js are all there. How can I fix this?"}}