Sha256: fb241e91f41e7e99f686298849f7cfaf4a6c6f7cf0a649c11fc3b284e4e9fe89
Contents?: true
Size: 1.01 KB
Versions: 30
Compression:
Stored size: 1.01 KB
Contents
class CommonDocumentsController < InheritedResources::Base belongs_to_subjects :optional => true before_filter :profile_subject!, :only => :index load_and_authorize_resource :except => :index def show path = resource.file.path(params[:style]) respond_to do |format| format.all { send_file path, :filename => resource.file_file_name, :type => resource.file_content_type, :disposition => "inline" } end end def destroy @post_activity = resource.post_activity destroy! end private def collection @activities = profile_subject.wall(:profile, :for => current_subject, :object_type => Array(self.class.index_object_type)). page(params[:page]). per(params[:per]) end class << self def index_object_type controller_name.classify end end end
Version data entries
30 entries across 30 versions & 2 rubygems