Module: Mongoid::GridFsHelper

Defined in:
lib/mongoid/grid_fs.rb

Instance Method Summary collapse

Instance Method Details

#grid_fs_render(grid_fs_file, options = {}) ⇒ Object



562
563
564
565
566
567
568
569
# File 'lib/mongoid/grid_fs.rb', line 562

def grid_fs_render(grid_fs_file, options = {})
  options.to_options!

  headers['Content-Disposition'] = "attachment; filename=#{grid_fs_file.attachment_filename}" if (options[:inline] == false) || (options[:attachment] == true)

  self.content_type = grid_fs_file.content_type
  self.response_body = grid_fs_file
end