Skip to content

Instantly share code, notes, and snippets.

@markandrewj
Created March 6, 2016 19:47
Show Gist options
  • Select an option

  • Save markandrewj/b907cc3f4b27caec4e24 to your computer and use it in GitHub Desktop.

Select an option

Save markandrewj/b907cc3f4b27caec4e24 to your computer and use it in GitHub Desktop.

Revisions

  1. markandrewj created this gist Mar 6, 2016.
    31 changes: 31 additions & 0 deletions block_comment
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    Define an empty method in your Ruby script.

    def comment
    end


    If you are using Rails you can add this to application_helpers.rb:

    module ApplicationHelper
    def comment
    end
    end

    Now you can use the new method:

    <% comment do %>
    <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
    </div>
    <% end %>


    Or even tweak it a little for more readability:

    <% comment do %>
    <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
    </div>
    <% comment end %>