Best way to add comments in erb

前端 未结 7 2005
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 06:45

How do we add comments in erb files, if we do not want them to be generated into the html content?

7条回答
  •  眼角桃花
    2020-12-04 07:08

    Since .erb is by definition "embedded ruby", you can embed every ruby code between: <%= and the other: %>, typically all written in one line. In addition, ruby one-line comments start always with #, so the <%=# Comment %> style matches perfectly with both pure-ruby and erb styles for one-line comments.

提交回复
热议问题