I have a lot of comments in Rails views.
How can I prevent their rendering?
If I understand the question correctly, you are asking for Ruby / Rails comments and HTML comments ... Try in your opinion:
<!-- This is an HTML comment and will show up in the HTML source! -->
Now try the following:
<%# This is a comment that won't show up in the HTML source! %> <%# You can even use this for commenting multiple lines! How useful! %>
Does it help?
use = begin and = end to mark the beginning and end of your comment
. , ERB , .
Rails, , Binging : http://blog.brijeshshah.com/strip-tags-in-rails-javascript-and-php/
, , - , , sanitize . sanitize - , , .
sanitize
, Haml : - # haml html.
,
:
<% comment do %> <%= "this won't be executed" %> or displayed <% end %>
in app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper def comment(&block) ## you can do something with the block if you want end end