Class: Commontator::ThreadsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Commontator::ThreadsController
- Defined in:
- app/controllers/commontator/threads_controller.rb
Instance Method Summary collapse
-
#close ⇒ Object
PUT /threads/1/close.
-
#reopen ⇒ Object
PUT /threads/1/reopen.
-
#show ⇒ Object
GET /threads/1.
Instance Method Details
#close ⇒ Object
PUT /threads/1/close
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/commontator/threads_controller.rb', line 18 def close raise SecurityTransgression unless @thread.can_be_edited_by?(@commontator) @thread.close(@commontator) @thread.thread_closed_callback(@commontator) respond_to do |format| format.html { redirect_to @commontable_url } end end |
#reopen ⇒ Object
PUT /threads/1/reopen
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/commontator/threads_controller.rb', line 30 def reopen raise SecurityTransgression unless @thread.can_be_edited_by?(@commontator) @thread.reopen respond_to do |format| format.html { redirect_to @commontable_url } end end |
#show ⇒ Object
GET /threads/1
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/commontator/threads_controller.rb', line 6 def show raise SecurityTransgression unless @thread.can_be_read_by?(@commontator) @thread.mark_as_read_for(@commontator) respond_to do |format| format.html { redirect_to @commontable_url } format.js end end |