Convert render code to coffeescript