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 module TopicsHelper
def lastpost topic 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
end end

View file

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