how to run ruby in haml in javascript definition?

后端 未结 2 1454
野趣味
野趣味 2021-02-07 23:56
  • how can I run ruby code inside javascript in haml?
  • if I use var = #{message} in my example I get undefined local variable or method message
2条回答
  •  礼貌的吻别
    2021-02-08 00:12

    The haml documentation for filters states that you can interpolate Ruby code using #{}

    - flavor = "raspberry"
    #content
      :textile
        I *really* prefer _#{h flavor}_ jam.
    

提交回复
热议问题