Search code examples
ruby-on-railsrubycommentserbblock-comments

Best way to add comments in erb


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


Solution

  • Use the <%# %> sequence, e.g.

    <%# This is a great comment! %>