Closed runemadsen closed 11 years ago
Hi @runemadsen,
Do you have an example of how this fails? The description sounds exactly like our setup (multiple JS assets are precompiled); each set includes whatever templates are necessary.
Thanks. It's hard to debug, because the views are just not there. I have 2 files:
application.js
//= require jquery
//= require jquery_ujs
//= require handlebars.runtime
//= require_directory ./some_views
shared.js
//= require handlebars.runtime
//= require_directory ./other/code
//= require_directory ./other/views
Everything in application.js works. The views get compiled, and it's all great. Everything BUT the views work in shared.js. Which means, that it's all included on the page, but my views are not in the HandlebarTemplates variable.
If I change application.js to this, all the views show up, including the ones from shared.js:
//= require jquery
//= require jquery_ujs
//= require handlebars.runtime
//= require_directory ./some_views
//= require_directory ./other/views
Hi @runemadsen,
What is config.assets.precompile
set to in your environment file?
In production.rb:
config.assets.precompile += ['shared.js']
Maybe that should go in application.rb, so it's effective in development also?
Hi @runemadsen,
Yup :)
Thanks so much. Really appreciate it.
Hi @runemadsen,
No worries, good luck!
I have a separate .js file that gets compiled, called shared.js. If I add handlebars.runtime and require my views in that file, it won't work.