I have been using the function below to generate text for Bootstrap's tooltip plugin. Why is it that multiline tooltips only work with <br>
and not \n
? I would prefer to avoid having any HTML in my links' title attributes.
Current Solution
def tooltip(object)
tooltip = ""
object.each do |user|
tooltip += "#{user.identifier}" + "<br>"
end
return tooltip
end
Desired Solution
def tooltip(object)
tooltip = ""
object.each do |user|
tooltip += "#{user.identifier}" + "\n"
end
return tooltip
end