可能重複:
Best way to use html5 data attributes with rails content_tag helper?導軌 - 的link_to助手與數據 - *屬性
如何使用HTML5 data-*
attrubute在我的link_to助手(Rails)的
的API說,我必須使用這種格式link_to(body, url, html_options = {})
,但我有一個錯誤,當我把它放在html_options
例如:
link_to "whatever", @whatever_path, { class: 'my_class', data-tooltip: 'what I want' }
你目前的嘗試是什麼樣的? – 2012-01-04 22:05:21