- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用 Prawn 插件创建了 Rails 应用程序的 pdf 版本,有问题的页面是 Kase 模型的一部分 - kase 的链接是/kases/1,而 pdf 版本的链接是/kases/1.pdf .
如何将 show.html.erb 中的链接添加到 PDF 文件,以便查看哪个页面,它将 URL 更新为正确的案例 ID?
<% content_for :header do -%>
<%=h @kase.jobno %> | <%=h @kase.casesubject %>
<% end -%>
<!-- #START SIDEBAR -->
<% content_for :sidebar do -%>
<% if @kase.avatar.exists? then %>
<%= image_tag @kase.avatar.url %>
<% else %>
<p style="font-size:smaller"> You can upload an icon for this case that will display here. Usually this would be for the year number icon for easy recognition.</p>
<% end %>
<% end %>
<!-- #END SIDEBAR -->
<ul id="kases_showlist">
<li>Date Instructed: <span><%=h @kase.dateinstructed %></span></li>
<li>Client Company: <span><%=h @kase.clientcompanyname %></span></li>
<li>Client Reference: <span><%=h @kase.clientref %></span></li>
<li>Case Subject: <span><%=h @kase.casesubject %></span></li>
<li>Transport<span><%=h @kase.transport %></span></li>
<li>Goods<span><%=h @kase.goods %></span></li>
<li>Case Status: <span><%=h @kase.kase_status %></span></li>
<li>Client Company Address: <span class="address"><%=h @kase.clientcompanyaddress %></span></li>
<li>Client Company Fax: <span><%=h @kase.clientcompanyfax %></span></li>
<li>Case Handler: <span><%=h @kase.casehandlername %></span></li>
<li>Case Handler Tel: <span><%=h @kase.casehandlertel %></span></li>
<li>Case Handler Email: <span><%=h @kase.casehandleremail %></span></li>
<li>Claimant Name: <span><%=h @kase.claimantname %></span></li>
<li>Claimant Address: <span class="address"><%=h @kase.claimantaddress %></span></li>
<li>Claimant Contact: <span><%=h @kase.claimantcontact %></span></li>
<li>Claimant Tel: <span><%=h @kase.claimanttel %></span></li>
<li>Claiment Mob: <span><%=h @kase.claimantmob %></span></li>
<li>Claiment Email: <span><%=h @kase.claimantemail %></span></li>
<li>Claimant URL: <span><%=h @kase.claimanturl %></span></li>
<li>Comments: <span><%=h @kase.comments %></span></li>
</ul>
<!--- START FINANCE INFORMATION -->
<div id="kase_finances">
<div class="js_option">
<h2>Financial Options</h2><p class="finance_showhide"><%= link_to_function "Show","Element.show('finance_showhide');" %> / <%= link_to_function "Hide","Element.hide('finance_showhide');" %></p>
</div>
<div id="finance_showhide" style="display:none">
<ul id="kases_new_finance">
<li>Invoice Number<span><%=h @kase.invoicenumber %></span></li>
<li>Net Amount<span><%=h @kase.netamount %></span></li>
<li>VAT<span><%=h @kase.vat %></span></li>
<li>Gross Amount<span><%=h @kase.grossamount %></span></li>
<li>Date Closed<span><%=h @kase.dateclosed %></span></li>
<li>Date Paid<span><%=h @kase.datepaid %></span></li>
</ul></div>
</div>
<!--- END FINANCE INFORMATION -->
<%= link_to 'Edit Case', edit_kase_path(@kase) %> |
<%= link_to 'Back', kases_path %> |
<a href="#">Top</a>
<div style="width:120%; height: 50px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"> </div>
<div class="js_option_kaseemails">
<%= link_to_function "Show",
"Element.show('newinstructionemail1');"
%> /
<%= link_to_function "Hide",
"Element.hide('newinstructionemail1');"
%>
</div>
<h3>New Instruction Email</h3>
<div id="newinstructionemail1" style="display:none">
<p class="kase_email_output">
Hi,<br />
<br />
Many thanks for your instructions in the subject matter.<br />
<br />
We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
<br />
We have started our inquiries and will be in touch.<br />
<br />
Best Regards,<br />
<br />
<strong><%=h current_user.name %></strong>
<br />
McClelland & Co<br />
PO Box 149<br />
Southport<br />
PR8 4GZ<br />
<br />
Tel: +(0) 1704 569871<br />
Fax: +(0) 1704 562234<br />
Mob: <%=h current_user.mobile %><br />
E-mail: <%= current_user.email %><br />
<br />
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you receive this e-mail in error please notify the originator of the message.
<br /><br />
McClelland & Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland & Co cannot accept liability for any damage sustained as a result of software virus infection.
</p>
<%= link_to 'Edit Case', edit_kase_path(@kase) %> |
<%= link_to 'Back', kases_path %> |
<a href="#">Top</a>
</div>
<div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"> </div>
<div class="js_option_kaseemails">
<%= link_to_function "Show",
"Element.show('newinstructionemail');"
%> /
<%= link_to_function "Hide",
"Element.hide('newinstructionemail');"
%>
</div>
<h3>New Instruction Email</h3>
<div id="newinstructionemail" style="display:none">
<p class="kase_email_output">
Hi,<br />
<br />
Many thanks for your instructions in the subject matter.<br />
<br />
We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
<br />
We have started our inquiries and will be in touch.<br />
<br />
Best Regards,<br />
<br />
<strong><%=h current_user.name %></strong>
<br />
McClelland & Co<br />
PO Box 149<br />
Southport<br />
PR8 4GZ<br />
<br />
Tel: +(0) 1704 569871<br />
Fax: +(0) 1704 562234<br />
Mob: <%=h current_user.mobile %><br />
E-mail: <%= current_user.email %><br />
<br />
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you receive this e-mail in error please notify the originator of the message.
<br /><br />
McClelland & Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland & Co cannot accept liability for any damage sustained as a result of software virus infection.
</p>
<%= link_to 'Edit Case', edit_kase_path(@kase) %> |
<%= link_to 'Back', kases_path %> |
<a href="#">Top</a>
</div>
<div style="width:120%; height: 20px; background-color: black; margin: 10px 0 0 -19px; padding: 0; background-color: #d4d4d4;"> </div>
<div class="js_option_kaseemails">
<%= link_to_function "Show",
"Element.show('newinstructionemail2');"
%> /
<%= link_to_function "Hide",
"Element.hide('newinstructionemail2');"
%>
</div>
<h3>New Instruction Email</h3>
<div id="newinstructionemail2" style="display:none;">
<p class="kase_email_output">
Hi,<br />
<br />
Many thanks for your instructions in the subject matter.<br />
<br />
We have allocated reference number <%=h @kase.jobno %> to the above claim.<br />
<br />
We have started our inquiries and will be in touch.<br />
<br />
Best Regards,<br />
<br />
<strong><%=h current_user.name %></strong>
<br />
McClelland & Co<br />
PO Box 149<br />
Southport<br />
PR8 4GZ<br />
<br />
Tel: +(0) 1704 569871<br />
Fax: +(0) 1704 562234<br />
Mob: <%=h current_user.mobile %><br />
E-mail: <%= current_user.email %><br />
<br />
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you receive this e-mail in error please notify the originator of the message.
<br /><br />
McClelland & Co has taken every reasonable precaution to ensure that any attachment to this e-mail has been checked for viruses but it is strongly recommended that you carry out your own virus check before opening any attachment. McClelland & Co cannot accept liability for any damage sustained as a result of software virus infection.
</p>
<%= link_to 'Edit Case', edit_kase_path(@kase) %> |
<%= link_to 'Back', kases_path %> |
<a href="#">Top</a>
</div>
最佳答案
对于任何有兴趣的人...
<p><%= link_to "Printable Case (PDF)", kase_path(@kase, :format => 'pdf') %></p>
关于ruby-on-rails - Rails 链接到 PDF 版本的 show.html.erb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2700969/
我在 Rails 应用程序上使用 chessboard-0.3.0.js。由于 Rails Assets 管道的问题,我必须编辑渲染图像的 js 代码的每个部分,例如 Pieces。chessboar
我有一个简单的 fixture.yml 文件: label: body: "" 问题是 ERB 代码被解析为加载 fixture 的一部分,而我实际上希望正文字面意思是“”(未插值)。 如何逃
这是erb3.rb require 'erb' weekday = Time.now.strftime('%A') simple_template = "Today is ." renderer =
name.html.erb 和 name.erb 有什么区别?特别是,是否有任何原因导致 name.erb 不好用? 我知道 name.html.erb 是约定 - 这表示 HTML 模板和 ERB
.erb、.rhtml 和 .html.erb 之间有什么区别? 最佳答案 没什么,真的。这只是 Rails 1 和 Rails 2 之间理念的改变。在 Rails 2 之前,有 file.rhtml
我想知道是否有一个 API 可以很好地支持 eRuby (erb) 和 JavaScript 突出显示、语法分析和代码辅助。 我已经尝试过使用 Aptana 来使用 Eclipse RadRails
我正在尝试在 Rails 应用程序上的示例 ruby 上实现 jquery。我刚刚开始探索js。我知道我在 js/jquery 方面还有很多东西要学。现在有件事让我很困惑。 我有一个 js.erb
我有一个导航栏,它显示未读消息数。未读计数必须在导航栏文本中进行格式化,因此我使用了以下内容: false}).count(:id, :distinct => true).to_s}", conve
我正在编写一个显示代码和输出的样式指南。它目前的结构使得代码只需要描述一次,并以其原始版本和解释版本显示,如下所示: #{ image_tag 'image.png' } PLACE_THE
我的大多数 js.erb 文件底部都包含类似这样的内容: $("#flash_message").html(" "note")) %>"); $("#flash_message").fadeOut(2
我的目标是使用相同的 Controller 调用 html.erb 和 js.erb 文件,但它只调用我的 html 文件。 我的 js 没有被调用。 Controller /categories_c
尝试将* .html.slim View 转换为* .html.erb。 我看了以下两个问题: How can I convert html.slim to html.erb?-从控制台调用时获取un
我正在 Eclipse 中开发 jRuby on Rails 应用程序。我最近安装了 Aptana 以更好地支持 rails 文件。这为大多数文件类型提供了合理的突出显示和支持,包括“html.erb
过去几天我一直在尝试理解 Rails 上 AJAX 的不同方面。在阅读了一些介绍后,我对 Rails 内置的 UJS 功能有了一定的了解。我编写的一个小玩具应用程序的示例,我想在其中引入一些 AJAX
我在不同模型的 ajax 响应之间有重复的 js.erb 代码。我想通过将参数传递到 js.erb 部分来重构重复的 js.erb 代码。 如何从 js.erb 文件渲染 js.erb 部分? 最佳答
我的 Rails 应用程序正在为特定窗口使用 js.erb View 而不是 html.erb View 。这在实践中很好用,但是当我对 capybara 使用 cucumber 测试时,它给我一个错
我尝试使用 rails-erb-loader。 在我的 home.component.ts import templateString from './home.component.html'; 我有
我刚刚花了最后一个小时浏览 Atom 论坛寻找答案。有没有人想通了? 最佳答案 core: customFileTypes: "text.html.ruby": [
我没能找到讨论 create.js.erb 和 destroy.js.erb 如何适合 Rails 3 应用程序的文档。 app > Controller 中这些类型的 Javascript 文件背后
我目前正在尝试将 vue.js v-model 包含到我的 erb 表单输入标签中,但我找不到正确的语法。 这是我的代码目前的样子: 如果有任何想法,我将不胜感激。谢谢! 最佳答案 试试这
我是一名优秀的程序员,十分优秀!