Created
March 6, 2016 19:47
-
-
Save markandrewj/b907cc3f4b27caec4e24 to your computer and use it in GitHub Desktop.
block comment helper for ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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