CoffeeCup provides inheritable utilities for CoffeeScript classes under Rails 3.2
Include CoffeeCup in your Gemfile.
gem "coffee_cup"
Include CoffeeCup in your application.js manifest file.
//= require coffee_cup
Extend CoffeeCup in your own classes.
class window.Testing extends CoffeeCup default_options: name: 'Frank' init: -> # Initialize stuff here welcome: -> @log "Welcome #{@options.name}!"
Instantiate your objects like normal.
$ -> test = new Testing( { debug: true, name: "Bob" } ) test.welcome() # outputs the following... # Testing.log > Welcome Bob!