Answer the question
In order to leave comments, you need to log in
How to turn JS code into CoffeeScript in RoR framework?
Hello!
Here is the HTML where it is called:
<div class='list-cart-up-key' onclick="listActions.cartUpKey(this)"></div>
<div class='list-cart-counter' >0</div>
<div class='list-cart-down-key' onclick="listActions.cartDownKey(this)"></
var listActions = {
cartUpKey: function(it){
alert('UP');
},
cartDownKey: function(it){
alert('DOWN');
}
}
Answer the question
In order to leave comments, you need to log in
listActions =
cartUpKey: (it) ->
alert('UP')
cartDownKey: (it) ->
alert('DOWN')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question