aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-05-18 11:21:05 +0100
committerFrancis Irving <francis@mysociety.org>2010-05-18 11:21:05 +0100
commit5dd5f82918466c4ade21d4fe26dfc776f5cdc874 (patch)
treeb8adc56e96dcf17b2b9c2c8143090478bc6f7ce4 /app/controllers/request_controller.rb
parent7064e02a0017240e6eb9cdbda02ba6ad3a97e0e3 (diff)
Use right cache dir for images in converted pdfs/docs
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index cca96214b..120bb38ce 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -578,7 +578,9 @@ class RequestController < ApplicationController
# images made during conversion (e.g. images in PDF files) are put in the cache directory, so
# the same cache code in cache_attachments above will display them.
- image_dir = File.dirname(ActionController::Base.cache_store.cache_path + "/views" + url_for(params.merge(:only_path => true)))
+ key = params.merge(:only_path => true)
+ key_path = foi_fragment_cache_path(key)
+ image_dir = File.dirname(ActionController::Base.cache_store.cache_path + "/views" + key_path)
FileUtils.mkdir_p(image_dir)
html, wrapper_id = @attachment.body_as_html(image_dir)