h is an alias of the html_escape method in Rails.
If you do not avoid the text with h, then someone can write javascript there and it will be executed when you display the page.
So, if you are not sure that the data that you show is absolutely safe, run it through a filter that eludes characters from HTML tags.
source share