Class: SimpleDiscussion::ForumCategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/simple_discussion/forum_categories_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#is_moderator?, #is_moderator_or_owner?, #page_number, #require_mod_or_author_for_post!, #require_mod_or_author_for_thread!

Instance Method Details

#indexObject



4
5
6
7
8
# File 'app/controllers/simple_discussion/forum_categories_controller.rb', line 4

def index
  @forum_threads = ForumThread.where(forum_category: @category) if @category.present?
  @forum_threads = @forum_threads.pinned_first.sorted.includes(:user, :forum_category).paginate(per_page: 10, page: page_number)
  render "simple_discussion/forum_threads/index"
end