HTML title attribute in Rails displaying only first word

后端 未结 3 603
再見小時候
再見小時候 2020-12-22 01:32

Got a weird little problem.

I want to create the text hover on an item to display that item\'s \"description,\" which is an attribute of that item\'s model. So I ba

3条回答
  •  臣服心动
    2020-12-22 02:02

    I think you need to add quoting to the HTML in the view. If you view source on the generated HTML, I'm willing to bet it looks like this:

    The browser will interpret that as the div having a title with the value This, and then attributes named is, a, super, cool, and item!.

    If you change your view to this:

    Then your generated HTML should look like this:

提交回复
热议问题