小编Elo*_*dis的帖子

使用rails send_data发送PDF

我使用ruby 1.9.3和redmine 1.4.4

根据这个 - > 请帮我发送一个jpg文件使用send_data,我在控制器中这样做:

  @file = temp.path
  File.open(@file, 'r') do |f|
    send_data f.read, :filename => "myfile.pdf", :type => "application/pdf", :disposition => "attachment"
  end
  File.delete(@file)
Run Code Online (Sandbox Code Playgroud)

但它回来了ArgumentError (invalid byte sequence in UTF-8),为什么?

ruby ruby-on-rails redmine

7
推荐指数
1
解决办法
1万
查看次数

将angularCompileRows设置为true时,无法读取null的属性'$ apply'

我使用AngularJS 1.7和ag-grid 18.0.1.

当我将angularCompileRows设置为true时,我在控制台中出现此错误:

Uncaught TypeError: Cannot read property '$apply' of null
at eval (rowRenderer.js:586)
Run Code Online (Sandbox Code Playgroud)

这是相应的代码(这是agGrid代码):

RowRenderer.prototype.checkAngularCompile = function () {
    var _this = this;
    // if we are doing angular compiling, then do digest the scope here
    if (this.gridOptionsWrapper.isAngularCompileRows()) {
        // we do it in a timeout, in case we are already in an apply
        setTimeout(function () {
            _this.$scope.$apply();
        }, 0);
    }
};
Run Code Online (Sandbox Code Playgroud)

在这里我的选择:

const gridOptions = {
            rowData: null,
            columnDefs: [...],
            enableColResize: true,
            onColumnResized: (params) => {
            angularCompileRows: …
Run Code Online (Sandbox Code Playgroud)

angularjs ag-grid

7
推荐指数
1
解决办法
463
查看次数

标签 统计

ag-grid ×1

angularjs ×1

redmine ×1

ruby ×1

ruby-on-rails ×1