I know that it is possible to use the content_tag function in ruby-on-rails, which helps to generate the html tag. Some rail developers in the company I work with told me that this is a "convenient and correct" way, and I should not write "native" html to generate a div, for example ... Is this true? Is this some kind of rails? Does this have anything to do with performance or rendering speed issues?
I am attaching codes for my previous code:
<div class="alert alert-<%= key %>"><%= value %></div>
and using the rails function
<%= content_tag(:div, value, class: "alert alert-
The first look at me is pretty clear and intuitive - more than the second code. What do you think about this?
benams
source share