I have Rails app using Asset Pipeline. There are many js files associated with different parts of the app. To keep it DRY I want to start pulling some of the repetitive code into a file and use those methods throughout the app. What I am attempting right now isn't working.
Uncaught ReferenceError: common is not defined
Putting it in the window object ended up being my solution. I'm not sure it's ideal, but it works.
window.common = some_commonly_used_method: -> // code