Sha256: 413604a65bbcebf5d6fd8520fa24ee11d6cca2f183be25caee7d71038d10ac7e

Contents?: true

Size: 889 Bytes

Versions: 1

Compression:

Stored size: 889 Bytes

Contents

module Commontator
  class ThreadsController < ApplicationController
    before_filter :get_thread
    before_filter :get_commontable_url, :only => :show

    # GET /threads/1
    def show
      commontator_thread_show(@thread.commontable)

      respond_to do |format|
        format.html { redirect_to @commontable_url }
        format.js
      end
    end
    
    # PUT /threads/1/close
    def close
      raise SecurityTransgression unless @thread.can_be_edited_by?(@user)

      @thread.close(@user)
      @thread.thread_closed_callback(@user)

      respond_to do |format|
        format.html { redirect_to @thread }
      end
    end
    
    # PUT /threads/1/reopen
    def reopen
      raise SecurityTransgression unless @thread.can_be_edited_by?(@user)

      @thread.reopen

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commontator-0.5.12 app/controllers/commontator/threads_controller.rb