2015-10-18 65 views
3

我想實現我的苗條觀點引導酥料餅,但到目前爲止,它沒有工作:enter image description here不能讓引導酥料餅的工作,苗條

這裏是我的苗條鑑於問題的一部分:

td = tournament.subscriptions.count 
td data: {container: body, html: true, content: hello, toggle: popover, placement: top, trigger: hover, title: dispo} 
    = tournament.subscriptions.where(status: "confirmed").count 

我我認爲我尊重語法,但它仍然無法正常工作。有任何想法嗎 ?

回答

1

問題是,您正嘗試使用散列來定義td標記的屬性。

這應該爲你工作:

td data-container='body' data-html='true' data-content='hello' data-toggle='popover' data-placement='top' data-trigger='hover' title='dispo' 

幾件事情要注意,修改後的td行:

  1. 所有除了title屬性是數據的屬性,所以我說「數據「給他們。
  2. 我假設「hello」和「dispo」應該是字符串,所以我引用了它們。如果這些實際上是變量,則只需使用"#{dispo}""#{hello}"

而如果你不這樣做已經,一定要火popover方法,讓您的popovers到實際工作:

$('[data-toggle="popover"]').popover();