Closed anselmbradford closed 10 years ago
@anselmbradford Not our problem. See this policy change.
Requirejs call in layout looks like requirejs_include_tag("routes/#{controller_name}/#{action_name}")
@anselmbradford Well yeah, but you still have to add in the config.assets.precompile
list manipulation, because the Rails people want to prevent surprises in production.
@carsomyr Thanks for the quick response. What's the recommended config for a requirejs-rails deploy in respect to this policy change?
Sorry, that earlier comment was out of sync :D posted before I saw your comment. So add:
Rails.application.config.assets.precompile += %w(routes/home/index.js routes/about/index.js routes/locations/index.js routes/locations/show.js)
To assets.rb
?
@anselmbradford Yes.
@carsomyr Cool, thank you. This would suggest https://github.com/jwhitley/requirejs-rails#avoid-configassetsprecompile needs to be updated? Is the approach to per route modules I'm using in the project shown seem correct?
Is @anselmbradford's last comment (Oct 13, 2014) correct? Is the README section about avoiding config assets precompile out of date?
In development with custom modules (see https://github.com/codeforamerica/ohana-web-search/blob/master/config/requirejs.yml#L13-L17), sprockets complains about the assets not being precompiled:
See https://github.com/codeforamerica/ohana-web-search/blob/master/config/environments/development.rb for development settings. I've tried adding
config.assets.digest = true
with no luck.