Sublime erb comment label

The sublime command + / does not work for me to comment on erb, and also cannot block the comment from erb + html, does anyone know how to fix this, maybe the package?

For example, I want to comment on this code in sublime form:

1 <% post.categories.each do |category| %> 2 <%= category.name %> 3 <% end %> 

I can’t just “command + /” or “command + option + /” to select, because either of them only places a regular html style comment around the selection. If I try to comment only on the line with the + / command, it places the pound symbol # in front of the line - a comment on ruby, not erb.

Instead of commenting on this, I will need to put a pound sign in the first line, then put a pound sign in the second line and an html comment around it, and then put a pound sign in the third line.

So in the end it will look like

 <%# post.categories.each do |category| %> <!-- <%#= category.name %> --> <%# end %> 

I chose HTML (Rails).

+6
source share
2 answers

Make sure you follow the steps in this github link provided in rails . the package installing and editing keys is clearly explained there.

+3
source

using the SublimeERB plugin , you can switch between different erb tag modes, including comment style.

enter image description here

+2
source

All Articles