Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1 not detecting Coffeescript and Javascript changes?

Sometimes I update my Coffee code in Rails 3.1 and it doesn't detect any of the changes, ie. I refresh my browser/cache and it still invokes the old script. Anyone know what causes this?

EDIT: I even litter my entire scripts with "debugger" and none of them ever gets called. Any idea why it simply won't refresh the Coffeescripts?

EDIT2: I realize that it doesn't even detect javascript changes sometimes. Am I missing something? Note I am not bouncing my server when I change JS files... It used to work...

like image 551
kidcapital Avatar asked Nov 06 '11 05:11

kidcapital


1 Answers

For the development environment you could try to rake assets:clean. Rails sometimes reads the precompiled assets in development environment, so this will clean them and the fresh ones will be loaded.

For the production environment try to rake assets:precompile, so that the changes are compiled and stored in the assets files.

like image 166
Ion Br. Avatar answered Sep 29 '22 09:09

Ion Br.