在我的rails 3应用程序中,我提供了一个供用户下载的CSV模板。而不是下载它只是在新标签中打开文本。这里是代码:Rails CSV附件在浏览器中打开而不是下载
<a href="/templates/myFile.csv" target="_blank">click here</a>
这是我以前的工作,我不知道什么可以改变打破它。其他与此类似的问题表明添加target='_blank'
或更改标题,但我没有太多运气。
我不认为它应该有所作为,但这个链接是一个模式谁是身体内部的来自这里:
<div class="modal hide" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<%= modal_header "Help" %>
<div class="modal-body">
<%= render 'help' %>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>