Skip to content

Instantly share code, notes, and snippets.

@markandrewj
Created March 6, 2016 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markandrewj/b907cc3f4b27caec4e24 to your computer and use it in GitHub Desktop.
Save markandrewj/b907cc3f4b27caec4e24 to your computer and use it in GitHub Desktop.
block comment helper for ruby
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 %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment