From last week i tried the Ember-Rails and studied the coffee script btw. Because more and more people use coffee script and i want to understand their codes!
In the beginning the coffee script syntax confuses me a lot and cost a lot of time to google it.
I decide to keep it on post for reference in the future.
The indent is the most important to coffeescript. Wrong indent cause compile fail.
For example: define a method to call ajax. You can insert variable into string using "#{}". @successHandle is the same as this.successHandle.
All variable definition will be scoped in function. If you want to def a variable in each loop, you should use do () ->
123456789101112
check = ()->forpersoninpeoplepost = newPost()person.setPostpost#every person has the same post referencecheck = ()->forpersoninpeopledo(person) ->post = newPost()person.setPostpost#every person has his post