Class: Formol::ForumsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#last_page_forum_topic_path, #paginated_forum_topic_post_path, #per_page, #topic_last_page_number, #topic_post_page_number

Instance Method Details

#mark_as_readObject



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

def mark_as_read
  formol_authorize!(current_formol_user, :read_forum)
  
  forum.mark_as_read(current_formol_user) if current_formol_user
  
  respond_with(forum)
end

#showObject



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

def show
  formol_authorize!(current_formol_user, :read_forum)
  
  @topics = forum.topics.ready_for_listing.page(params[:page]).per_page(per_page)
  
  respond_with(forum)
end