aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-10-28 18:23:31 +0000
committerfrancis <francis>2008-10-28 18:23:31 +0000
commita0c126caceb8b0b4a524b549914bcdee95ff8c7d (patch)
tree56282d8b59baae7f9db03f127b4cb7082d4090f3 /app/controllers/request_controller.rb
parentfd61d6e1c05f60e472910a70dfe3ac103f99db97 (diff)
Show images properly
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 6b9ad780b..c71c2f804 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_controller.rb,v 1.131 2008-10-28 17:58:48 francis Exp $
+# $Id: request_controller.rb,v 1.132 2008-10-28 18:23:31 francis Exp $
class RequestController < ApplicationController
@@ -405,7 +405,10 @@ class RequestController < ApplicationController
caches_page :get_attachment_as_html
def get_attachment_as_html
get_attachment_internal
- html = @attachment.body_as_html
+
+ image_dir = File.dirname(Rails.public_path + url_for(params.merge(:only_path => true)))
+ FileUtils.mkdir_p(image_dir)
+ html = @attachment.body_as_html(image_dir)
view_html_stylesheet = render_to_string :partial => "request/view_html_stylesheet"
html.sub!(/<head>/i, "<head>" + view_html_stylesheet)