In production you can only reference (javascript_include_tag
, stylesheet_link_tag
) assets that have been precompiled. By default this is just application.js and application.css. These top level files (called manifests) contain directives saying what files to include (by default this include app/assets/javascripts/* for example).
Anything that is to be referenced directly needs to be added to config.assets.precompile
The sprockets_better_errors gem will warn you about these in development.