如何data-*在我的link_to帮助器(Rails)中使用html5 attrubute
API说我必须使用这种格式,link_to(body, url, html_options = {})但是当我把它放在html_options中时我有一个错误
例如:
link_to "whatever", @whatever_path, { class: 'my_class', data-tooltip: 'what I want' }
Run Code Online (Sandbox Code Playgroud) 我正在使用Twitter的Bootstrap,我有以下HTML:
<a class="btn" href="<%= user_path(@user) %>"><i class="icon-ok icon-white"></i> Do it@</a>
Run Code Online (Sandbox Code Playgroud)
在Rails中执行此操作的最佳方法是什么?我想用,<%= link_to 'Do it', user_path(@user) %>但是让<i class="icon-ok icon-white"></i>我失望了吗?