Writing erb in Rails, you’re probably used to escaping HTML like this:
<%=h article.author %>
You can get this functionality in Sinatra by adding this to your helpers:
helpers do
alias_method :h, :escape_html
end
Writing erb in Rails, you’re probably used to escaping HTML like this:
<%=h article.author %>
You can get this functionality in Sinatra by adding this to your helpers:
helpers do
alias_method :h, :escape_html
end