Call javascript function onclick in Rails

前端 未结 2 1309
Happy的楠姐
Happy的楠姐 2021-02-08 18:26

I have the following code in one of my views:


And, the .js.

2条回答
  •  死守一世寂寞
    2021-02-08 18:48

    Change this:

    analyze = ->
    

    To this:

    window.analyze = ->
    

    Functions in coffeescript are not global by default.

提交回复
热议问题