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. However, when I deploy to Heroku, the application complains that it can’t find the template.
ActionView::MissingTemplate (Missing template /expenses/create with {:handlers=>[:erb, :builder], :formats=>[:js, :html], :locale=>[:en, :en]}. Searched in:
* "/app/app/views"
* "/app"
* "/"
):
It’s clear that the coffee handler is not there to preprocess *.js.coffee template.
Can any one suggest how I can configure Heroku to recognize and process these templates?
Note: Heroku is successfully preprocessing my CoffeeScript files that are present in the asset pipeline.
I’m a bit late to the party, but here is my solution, as posted on Github.
I just ran into a problem where my
create.js.coffeefile was working indevelopmentbut stopped working inproduction(on Heroku). The logs show that Rails isn’t even looking for a coffee handler:This is the (important) part of my Gemfile:
Only after I moved
coffee-railsoutside of the:assetsgroup, things started working. Perhaps it would be a good idea to somehow make this clear in the readme, and perhaps even ship Rails with thecoffee-railsplugin being placed outside theassetsgroup.