I have shared.js.coffee
Shared =
shared_method: (msg) ->
alert(msg)
And I have test.js.coffee
Shared.shared_method("this doesn't work")
And I load the shared code first in application.js as described https://stackoverflow.com/a/20563242/656510
//= require ./shared
//= require_tree .
However it does not work in development, i get: Uncaught ReferenceError: Shared is not defined
When i look at the JS it is being served as separate files rather than being compiled into application.js as it would in production.
As i thought it could be to do with Asset Pipeline configuration I created a clean Rails 4.1 app which demonstrates the problem.
https://github.com/itinsley/asset_pipeline_weirdness
Help greatly appreciated.