# HG changeset patch # User Jittat Fakcharoenphol # Date 2014-10-22 16:38:48 # Node ID fbebe9f8cc4b4addab3885d3272fd6a30e7655f6 # Parent 12f37667f516bc2a7fd73c7927591ee33b46a5e4 # Parent d5e7dd129618375e6230fe8baa9752470e1392e3 Merge pull request #10 from nattee/master Let PDF be viewable by the inline viewer of the browser 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