def show
      response.headers['Content-Length'] = @attachment.file.size.to_s
      send_file(
        @attachment.file.path,
        {
          filename: @attachment.file_name,
          type: @attachment.file_mime_type,
          disposition: 'inline'
        }
      )
    end
def show
      response.headers['Content-Length'] = @attachment.file.size.to_s
      send_file(
        @attachment.file.path,
        {
          filename: @attachment.file_name,
          type: @attachment.file_mime_type,
          disposition: 'inline'
        }
      )
    end
sends file inline. i.e. for viewing pdfs/movies in browser