diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 3324564..6f79862 100755 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -4,6 +4,10 @@ class ForumsController < ApplicationController before_filter :check_for_cancel + def show + @topics = @forum.topics.page(params[:page]).per(10) + end + def create if @forum.save flash[:notice] = "Forum was successfully created." diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 273de77..305069b 100755 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -27,7 +27,7 @@ <% end %> - <% @forum.topics.each do |topic| %> + <% @topics.each do |topic| %> <%= image_tag 'ruby.png' %> @@ -45,4 +45,7 @@ +
+ <%= paginate(@topics) %> +

<%= link_to "Back to Forum List", forums_path %>