Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-08-28 11:15:37 -05:00
commit 23890d6ec0
4 changed files with 17 additions and 13 deletions

View file

@ -26,7 +26,7 @@ class FileController < ApplicationController
end
else
# no form supplied, this is a request to download the file
file = @web.files_path + '/' + @file_name
file = @web.files_path.join(@file_name)
if File.exists?(file)
send_file(file)
else
@ -38,7 +38,7 @@ class FileController < ApplicationController
end
def blahtex_png
send_file(@web.blahtex_pngs_path + '/' + params['id'])
send_file(@web.blahtex_pngs_path.join(params['id']))
end
def delete

View file

@ -128,21 +128,18 @@ class Web < ActiveRecord::Base
"#{File.expand_path(dir)} and add files to it."
end
end
def files_path
path = Rails.root.join("webs")
if default_web?
"#{RAILS_ROOT}/webs/files"
path.join("files")
else
"#{RAILS_ROOT}/webs/#{self.address}/files"
path.join(address, "files")
end
end
def blahtex_pngs_path
if default_web?
"#{RAILS_ROOT}/webs/files/pngs"
else
"#{RAILS_ROOT}/webs/#{self.address}/files/pngs"
end
files_path.join("pngs")
end
private

View file

@ -46,7 +46,7 @@ class WikiFile < ActiveRecord::Base
end
def content_path
web.files_path + '/' + file_name
web.files_path.join(file_name)
end
def write_content_to_file