Class: SimpleForum::ForumsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simple_forum/forums_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
# File 'app/controllers/simple_forum/forums_controller.rb', line 6

def index
  @categories = SimpleForum::Category.default_order.includes({:forums => [{:recent_post => [:user, :topic]}, :moderators]})

  respond_to :html
end

#showObject



12
13
14
15
16
17
18
19
# File 'app/controllers/simple_forum/forums_controller.rb', line 12

def show
  bang_simple_forum_recent_activity(@forum)
  
  scope = @forum.topics.includes([:user, {:recent_post => :user}])
  @topics = scope.respond_to?(:paginate) ? scope.paginate(:page => params[:page], :per_page => params[:per_page]) : scope.all

  respond_to :html
end