Convert to coffeescript + rails