From 00883842f49d39800bf124ed97f7789ed3cbf27e Mon Sep 17 00:00:00 2001 From: xdite Date: Mon, 11 Feb 2013 19:18:17 +0800 Subject: [PATCH] render_topic_next_page_link --- app/helpers/topics_helper.rb | 4 ++++ app/views/topics/show.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb index bd1f3d3b0..96ec460cc 100644 --- a/app/helpers/topics_helper.rb +++ b/app/helpers/topics_helper.rb @@ -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 diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index 57439cbe9..869cd21c0 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -1,6 +1,6 @@

<%= render_topic_title(@topic_view.topic) %> - link_to(@topic_view.topic.title, @topic_view.topic.relative_url) +

<% (@post ? [@post] : @topic_view.posts).each do |post| %>
@@ -13,7 +13,7 @@ <% if @next_page%>

- <%= link_to("next page", @topic_view.topic.relative_url + "?page=" + @next_page ) %> + <%= render_topic_next_page_link(@topic_view.topic, @next_page) %>

<% end %>