11

Is there a way to configure ruby on rails to generate .js files and not .js.coffee when generating a new controller. I don't want to use CoffeeScript, and it's annoying having to refactor all my files.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Stefan Dunn
  • 5,363
  • 7
  • 48
  • 84

1 Answers1

30

from How can I completely disable CoffeeScript in a Rails 3.1 app?

Comment out gem "coffee-script" in your Gemfile
Use .js instead of .js.coffee for your javascript files
Community
  • 1
  • 1
Jeff Paquette
  • 7,089
  • 2
  • 31
  • 40
  • 1
    Removing coffee-script in my gemfile did the trick. Thanks – Stefan Dunn Apr 11 '13 at 09:30
  • This broke things on my app. I am using Devise plugin and the `sign_in` page wouldn't load. – Alexander Suraphel Feb 06 '17 at 07:12
  • I think this is a better answer. It shouldn't break any dependencies that need coffee-script: https://stackoverflow.com/questions/24232570/how-to-configure-rails-3-2-4-to-generate-js-instead-of-js-coffee-by-default – user3738936 Jul 29 '17 at 13:23