What needs to be configured for Heroku to handle templates based on CoffeeScript?

前端 未结 3 1531
青春惊慌失措
青春惊慌失措 2020-12-30 06:32

I have a create action that handles an AJAX request. On my development machine, a template named create.js.coffee is successfully processed to generate a javascript response

3条回答
  •  自闭症患者
    2020-12-30 06:57

    I'm even later to the party, but I just had the same problem and there's a simple explanation:

    The "assets" group of gems in the Gemfile are for development only. Heroku does not load these gems in production because it relies on its own stable versions for its Asset Pipeline.

    If you're using a special gem that sounds like it's related to the asset pipeline but doesn't actually belong to a standard pipeline (e.g. the "coffeebeans" gem) you should keep that gem outside the "Assets" group.

    I just tested this theory and it worked for me.

提交回复
热议问题