Sha256: ba551a2a11868ebc6abc5e68095ade4f5b06657bb1b93a1164a1852d7501bb92

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

class CommonDocumentsController < InheritedResources::Base
  belongs_to_subjects :optional => true

  load_and_authorize_resource

  def index
    @activities = subject.wall(:profile,
                               :for => current_subject,
                               :object_type => [:Picture]).
                          page(params[:page]).
                          per(params[:per])
  end
 
  def show
    path = resource.file.path(params[:style])

    respond_to do |format|
      format.all {
        send_file path, 
                  :type => resource.file_content_type,
                  :disposition => "inline"
      }
    end
  end
  
  def destroy
    @post_activity = resource.post_activity
    
    destroy!
  end

  private

  def subject
    @subject ||= parent || current_subject
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_stream-documents-0.1.8 app/controllers/common_documents_controller.rb
social_stream-documents-0.1.7 app/controllers/common_documents_controller.rb