Sha256: d883cdd2a1182b4e8669b8ddb96e94421fa76a3f003ef6aceded89831e7c3946

Contents?: true

Size: 978 Bytes

Versions: 2

Compression:

Stored size: 978 Bytes

Contents

module Commontator
  class ThreadsController < ApplicationController
    before_filter :get_thread

    # GET /threads/1
    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(@thread) }
        format.js
      end
    end
    
    # PUT /threads/1/close
    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(@thread) }
      end
    end
    
    # PUT /threads/1/reopen
    def reopen
      raise SecurityTransgression unless @thread.can_be_edited_by?(@commontator)

      @thread.reopen

      respond_to do |format|
        format.html { redirect_to commontable_url(@thread) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
commontator-0.4.1 app/controllers/commontator/threads_controller.rb~
commontator-0.3.10 app/controllers/commontator/threads_controller.rb~