In my Rails 4 app I have a users.js.coffee
file in app/assets/javascripts
. It compiles and works fine in development. But when I deploy to heroku it's not working. According to Railsguides:
The matcher (and other members of the precompile array; see below) is applied to final compiled file names. This means anything that compiles to JS/CSS is excluded, as well as raw JS/CSS files; for example, .coffee and .scss files are not automatically included as they compile to JS/CSS.
So I added the following line to my config/environments/production.rb
config.assets.precompile += %w ( users.js.coffee )
It's still not forcing the file to be precompiled. Do you know how I may force Rails to precompile it (I use RAILS_ENV=production bundle exec rake assets:precompile
to precompile)?
Thanks a lot.
Your config.assets.precompile
should contain users.js
, not users.js.coffee
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With