5

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.

1 Answer 1

8

Your config.assets.precompile should contain users.js, not users.js.coffee.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.