Fixes linking to latest posts in forums

This commit is contained in:
Luke Barratt 2014-06-06 21:27:52 +01:00
parent ad41e91c19
commit b2804bc941
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
module TopicsHelper
def lastpost topic
topic_url(topic, :page => topic.last_page, :anchor => "post_#{topic.posts.last.id}")
topic_url(topic, page: topic.last_page, anchor: "post_#{topic.latest.id}")
end
end

View file

@ -49,8 +49,8 @@
<td><%=h topic.cached_view_count %></td>
<td>
<%= link_to lastpost(topic) do %>
<%=h topic.posts.last.user %><br>
<%= shortdate(topic.posts.last.created_at) %>
<%=h topic.latest.user %><br>
<%= shortdate(topic.latest.created_at) %>
<% end %>
</td>
</tr>