Rails with Underscore.js Templates

后端 未结 2 786
别跟我提以往
别跟我提以往 2021-01-31 09:59

I was trying to use underscore.js templates for templating in a rails 2.3 app which does not have jammit as an asset packager.

Here is the simple Templa

2条回答
  •  臣服心动
    2021-01-31 10:50

    If you don't want to change the template settings across your entire project...

    Escape the ERB tags: <%= becomes <%%=

    
    

    Note that the closing tag is still %>, not %%>.


    Side note - I also tried outputting using a heredoc. The following code runs successfully but outputs a bunch of erb source code that gets caught between the heredoc commands.

    
    

提交回复
热议问题