Skip to content

Commit 5c4e6c9

Browse files
committed
Merge pull request discourse#153 from xdite/refactor_topic_show_again
use helper again
2 parents 036e795 + 9eca9f9 commit 5c4e6c9

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

app/helpers/topics_helper.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ def render_topic_title(topic)
44
link_to(topic.title,topic.relative_url)
55
end
66

7-
def render_topic_next_page_link(topic, next_page)
8-
link_to("next page", "#{topic.relative_url}?page=#{next_page}")
9-
end
107
end

app/views/topics/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h2>
2-
<a href="<%= @topic_view.relative_url %>"><%= @topic_view.title %></a>
2+
<%= render_topic_title(@topic_view.topic) %>
33
</h2>
44
<hr/>
55

@@ -15,7 +15,7 @@
1515

1616
<% if @topic_view.next_page %>
1717
<p>
18-
<a href="<%= @topic_view.next_page_path %>">next page &rarr;</a>
18+
<b><%= link_to("next page &rarr;", @topic_view.next_page_path ) %></b>
1919
</p>
2020
<% end %>
2121

0 commit comments

Comments
 (0)