Image attachments are now sent inline to be viewed directly in the browser.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@642 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-08-15 15:36:15 +00:00
parent c4239a4fd2
commit 38e0c237a4
3 changed files with 10 additions and 11 deletions
+4
View File
@@ -84,6 +84,10 @@ class Attachment < ActiveRecord::Base
container.is_a?(Project) ? container : container.project
end
def image?
self.filename =~ /\.(jpeg|jpg|gif|png)$/i
end
private
def sanitize_filename(value)
# get only the filename, not the whole path