# HG changeset patch # User Nattee Niparnan # Date 2014-10-01 15:48:06 # Node ID d5e7dd129618375e6230fe8baa9752470e1392e3 # Parent 6b25a7ebe31240527f9a64aa08a07a461854a88e fix pdf to use inline display of browsers (grafted from e31b572e8855ddcf56c682d6dd27999a434243d1) diff --git a/app/controllers/tasks_controller.rb b/app/controllers/tasks_controller.rb --- a/app/controllers/tasks_controller.rb +++ b/app/controllers/tasks_controller.rb @@ -60,7 +60,7 @@ content_type = 'application/octet-stream' end - send_file filename, :stream => false, :filename => base_filename, :type => content_type + send_file filename, :stream => false, :disposition => 'inline', :filename => base_filename, :type => content_type end end diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -3,3 +3,4 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone +Mime::Type.register 'application/pdf', :pdf