2

I try to comment out a Rails block in Atom.

When I use CTRL+/ I get:

Before:

  <%= form_for @subscriber do |f| %>
    <%= f.text_field :name, placeholder: "Name" %>
    <%= f.email_field :email, placeholder: "Email" %>
    <% f.select :source, ["Search Engine", "Social Media", "Word of Mouth", "Other"],
      prompt: "How did you hear about me?" %>
    <%= f.submit %>
  <% end %>

After:

  <%# <%= form_for @subscriber do |f| %>
    <%= f.text_field :name, placeholder: "Name" %>
    <%= f.email_field :email, placeholder: "Email" %>
    <% f.select :source, ["Search Engine", "Social Media", "Word of Mouth", "Other"],
      prompt: "How did you hear about me?" %>
    <%= f.submit %>
  <% end %> %>

Somehow Atom's default blocking does not work. As you can see, only the first line will be blocked.

How can I make sure I can block a Rails text properly?

I also tried using the Atom "ERB Comment-package", https://atom.io/packages/erb-comment. But this does not help.

Even if I try manually

  <!-- %= form_for @subscriber do |f| %>
    <%= f.text_field :name, placeholder: "Name" %>
    <%= f.email_field :email, placeholder: "Email" %>
    <% f.select :source, ["Search Engine", "Social Media", "Word of Mouth", "Other"],
      prompt: "How did you hear about me?" %>
    <%= f.submit %>
  <% end % -->

I still does only partially comment out the block and I even don't know the shortcut to the way of commenting out in Atom

All these Block comments in html.erb templates in rails solutions don't work in Atom. And besides, it does not give a proper Atom short-cut.

  • 2
    There is a huge difference between ERB comment lines `<%#` which output nothing (besides the trailing whitespace) and HTML comments ` – max Oct 20 '20 at 13:18

0 Answers0