在我的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>