mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-28 13:31:06 +00:00
Fixes linking to latest posts in forums
This commit is contained in:
parent
ad41e91c19
commit
b2804bc941
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue