Class: PostAttachmentsController

Inherits:
ForumBaseController show all
Defined in:
app/controllers/post_attachments_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject

this simple controller is only here to restrict access to post attachments if the forum is private, and to allow other extensions to add further restrictions



6
7
8
9
10
11
# File 'app/controllers/post_attachments_controller.rb', line 6

def show
  @attachment = PostAttachment.find(params[:id])
  size = params[:size] || 'original'
  expires_in 1.week, :public => true, :private => false
  send_file @attachment.file.path(size.to_sym), :type => @attachment.file_content_type
end