Question

I have code like this on my index page:

<% for article in @articles %>
  <%= link_to article_url(article, :anchor=>"comments") do %>
    <span><%= pluralize article.comments.count, "Comment" %></span>
  <% end %>
<% end %>

And I'm expecting it to link to the comments section of each blog post.

<a id="comments" name="comments"></a>

Everything works fine in FF, but when viewed in Chrome, only the first of these links will actually work as intended, and if any of the others are clicked then the viewport will automatically scroll to the bottom of the page once the article has loaded.

Any thoughts? I know there have been a few bugs regarding turbolinks and anchors but they were fixed. I will log this as an issue on github unless someone can point out what I'm doing wrong here.

Considering that I do this sort of thing on most of my sites, I'm hopeful of getting this working properly.

FWIW: Using WattOS, Chromium latest vrsn, Turbolinks 1.0 and Rails 3.2.11

Was it helpful?

Solution

This seems to have cleared up in Rails 4.0.0.beta1. I'll just close this off as fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top