From b27ef8c4658fa563b396e8c23364b5ede02c6eb9 Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Fri, 6 Jun 2014 21:27:52 +0100 Subject: [PATCH] Fixes linking to latest posts in forums --- app/helpers/topics_helper.rb | 2 +- app/views/forums/show.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb index 4b71271..2505b87 100644 --- a/app/helpers/topics_helper.rb +++ b/app/helpers/topics_helper.rb @@ -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 diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 7c40ef6..81ae62d 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -49,8 +49,8 @@ <%=h topic.cached_view_count %> <%= link_to lastpost(topic) do %> - <%=h topic.posts.last.user %>
- <%= shortdate(topic.posts.last.created_at) %> + <%=h topic.latest.user %>
+ <%= shortdate(topic.latest.created_at) %> <% end %>