render_topic_next_page_link

This commit is contained in:
xdite 2013-02-11 19:18:17 +08:00
parent 0f54dbb36e
commit 00883842f4
2 changed files with 6 additions and 2 deletions

View File

@ -3,4 +3,8 @@ module TopicsHelper
def render_topic_title(topic)
link_to(topic.title,topic.relative_url)
end
def render_topic_next_page_link(topic, next_page)
link_to("next page", topic.relative_url + "?page=" + next_page )
end
end

View File

@ -1,6 +1,6 @@
<h2>
<%= render_topic_title(@topic_view.topic) %>
link_to(@topic_view.topic.title, @topic_view.topic.relative_url)
</h2>
<% (@post ? [@post] : @topic_view.posts).each do |post| %>
<div class='creator'>
@ -13,7 +13,7 @@
<% if @next_page%>
<p>
<b><%= link_to("next page", @topic_view.topic.relative_url + "?page=" + @next_page ) %></b>
<b><%= render_topic_next_page_link(@topic_view.topic, @next_page) %></b>
</p>
<% end %>