Jasper-rails gem导致Rails 4“模板丢失”错误

时间:2014-11-13 02:05:17

标签: ruby-on-rails jasper-reports

我已经安装了jasper-rails 1.0.3并按照https://github.com/fortesinformatica/jasper-rails的说明进行操作。我的java安装很好。

这是我的控制器代码:

class ReportsController < ApplicationController
  respond_to :html, :xml, :pdf

  def index
    @council_report = CouncilReport.find(params[:council_report_id])
  end

  def proposed_works_summary
    @council_report = CouncilReport.find(params[:council_report_id])
    @proposed_works_summary = proposed_works_summary_data(@council_report.id)
    respond_with @proposed_works_summary
  end
end

我的routes.rb:

...
resources :reports, only: [:index] do
  member do
    get 'proposed_works_summary'
  end
end
...

以下是浏览器中的错误:

  

缺少模板

     
    

缺少模板报告/ proposed_works_summary,application / proposed_works_summary with {:locale =&gt; [:en],:formats =&gt; [:html],:variants =&gt; [],:handlers =&gt; [:erb ,:builder,:raw,:ruby,:jbuilder,:coffee]}。搜索:*“d:/ Users / Michael / Documents / Aptana Workspace / cam / app / views”

  

现在我显然有一个proposed_works_summary.jrxml iReport文件,我按如下方式设置了queryString:

<queryString language="XPath">
    <![CDATA[/reports/proposed_works_summary]]>
</queryString>

我详细检查了演示https://github.com/fortesinformatica/jasper-rails-demo,看不出我错过了什么。请帮助一点?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,我解决了它对jasper-rails进行了一些更新,因为它在Rails 4.2上不受支持,如果你愿意可以证明它jasper-rails