我正在尝试在我的 rails 应用程序中围绕 li 包装一个链接,我认为以下方法会起作用:
<%= link_to project_path(remix) do %>
<li>
<div class="remix-list-image"><%=link_to image_tag(remix.default_image.image_path_url(:preview), :class=>"img-polaroid"), project_path(remix) %></div>
<div class="remix-list-title"><%=link_to remix.title, project_path(remix) %> by <%= link_to remix.author, user_path(remix.user) %></div>
</li>
<% end %>
但它正在生成以下html:
<a href="/projects/206">
</a>
<li>
<a href="/projects/206"></a>
<div class="remix-list-image">
<a href="/projects/206"></a>
<a href="/projects/206"><img alt="Preview_2013-06-18_08.25.02" class="img-polaroid" src=""></a>
</div>
<div class="remix-list-title"><a href="/projects/206">Video Test Remix</a> by <a href="/users/tiff">tiff</a>
</div>
</li>
我希望它执行以下操作:
<a href ="/projects/206">
<li>...</li>
</a>
我究竟做错了什么?