I’ve just started using CoffeeScript with JQuery and Rails and I needed some system to organize my code. I’ve put all my classes and global variables in an app namespace, lets call it MyApp and for each controller I have a class and within that I have static methods for each action that is only run when that action is run.
The first thing I’ve done is put the controler and action in the body tag as data attributes:
So if the controller was
some_controller and the action was
index, it would generate a class name