Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1. How to prevent Rails to use CoffeScript?

How do I prevent Rails to enable CoffeeScript and use plain JavaScript instead?

like image 721
Shamaoke Avatar asked May 24 '11 14:05

Shamaoke


3 Answers

Comment out gem 'coffee-script' in Gemfile

like image 110
PeterWong Avatar answered Oct 10 '22 08:10

PeterWong


Just name your files .js instead of .js.coffee. This is a Tilt naming convention. Similarly, if you don't want to use SCSS, use .css instead of .css.scss. Or if you'd rather use the Sass syntax with semantic whitespace, use .css.sass.

By default, .js.coffee files are created by certain commands (notably generate controller) as long as gem 'coffee-script' is in the Gemfile, so you'll want to comment that out.

like image 29
Trevor Burnham Avatar answered Oct 10 '22 09:10

Trevor Burnham


Comment out # gem "coffee-script" in your gemfile or just use .js vs .js.coffee files

like image 29
adc Avatar answered Oct 10 '22 10:10

adc