how should I include a coffeescript file on only one page?

后端 未结 2 890
死守一世寂寞
死守一世寂寞 2021-02-05 05:06

Edit: a year later if I was going to do this again I\'d do it with curl.js instead of Rails asset pipeline.

Related: Best way to add page specific javascript in a Rails

2条回答
  •  青春惊慌失措
    2021-02-05 05:15

    Rather than only including the file on one page, you might want to just use logic that's conditional on the page markup. See my answer to a related question. That way, your users don't have to make an additional

提交回复
热议问题