I have a table "State", consisting of a few thousand records, and I'm printing each of their names on one page. Would adding a dynamic tooltip to each add noticeably to the load time of the page? In other words, would there be a significant performance difference between these two blocks of code?
<%= State.all.each do |state| %>
<%= state.name %>
<% end %>
or
<%= State.all.each do |state| %>
<%= link_to state.name, "#", title: "(" + state.weather + ")" %>
<% end %>
For the record, weather
is a instance method calculated by adding two State attributes together:
def weather
self.snow + self.rain
end