What is the h for in <td><%=h s.name %></td>?

<% songs.each do |s| %>

<%=h s.name %>
<% end %>

If i will remove the h…the output is still the same… thank you for
your replies

<% songs.each do |s| %>

<%=h s.name %> <% end %>

If i will remove the h…the output is still the same… thank you for
your replies

h is an alias for sanitize_html.

http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html

Try this…

<%= “bold?” %>

vs

<%= h “bold?” %>

That said… the behavior is different in Rails 3… which sanitizes by
default. So, in Rails three, try this…

<%= “bold?” %>

vs.

<%= raw “bold?” %>

-philip

Ahh…Now I understand better. Thank you Sir.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs