相关疑难解决方法(0)

Rails - 使用data-*属性的link_to帮助程序

可能重复:
使用rails content_tag helper使用html5数据属性的最佳方法是什么?

如何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)

html5 ruby-on-rails ruby-on-rails-3

104
推荐指数
2
解决办法
6万
查看次数

将link_to与嵌入式HTML一起使用

我正在使用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>我失望了吗?

ruby-on-rails twitter-bootstrap

97
推荐指数
7
解决办法
8万
查看次数