summaryrefslogtreecommitdiff
path: root/app/controllers/generic_files_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/generic_files_controller.rb')
-rw-r--r--app/controllers/generic_files_controller.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/generic_files_controller.rb b/app/controllers/generic_files_controller.rb
index b7dc453..b3c0390 100644
--- a/app/controllers/generic_files_controller.rb
+++ b/app/controllers/generic_files_controller.rb
@@ -17,7 +17,15 @@ class GenericFilesController < ApplicationController
end
def show
-
+ respond_to do |format|
+ format.html
+ format.xml {render :xml => @generic_file}
+ format.all {
+ if request.format == @generic_file.file_type
+ send_file @generic_file.file.path, :type => @generic_file.file_type, :filename => "#{@generic_file.name}.#{request.parameters[:format].to_s}"
+ end
+ }
+ end
end
def new