【发布时间】:2013-05-06 11:07:46
【问题描述】:
我的 Rails 应用程序有问题。我要链接
<h1><%= news.title %></h1>
像这样。但我想使用 link_to 而不是 HTML 标签“a”。
<a href="trainers-single.html" class="postTitle"><h1><%= news.title %></h1></a>
喜欢:
<%= link_to "<h1><%= news.title %></h1>", news, :class => "postTitle" %>
但它不接受它。正确的显示方式是什么?
【问题讨论】:
标签: ruby-on-rails