Sha256: aa99410996931787a7429107d0fad2678ce05d139dbcf933f93b9c9524acb116

Contents?: true

Size: 942 Bytes

Versions: 3

Compression:

Stored size: 942 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
        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 @thread }
        format.js
      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 @thread }
        format.js
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commontator-0.2.4 app/controllers/commontator/threads_controller.rb~
commontator-0.2.0 app/controllers/commontator/threads_controller.rb~
commontator-0.1.46 app/controllers/commontator/threads_controller.rb~