我想使用Rails中的引導框架將PDF鏈接到按鈕。例如,按鈕會說現在下載並鏈接到PDF。我不關心PDF如何打開,只是它與它鏈接。使用Bootstrap將按鈕鏈接到PDF文件
在Bootstrap文檔中,它說只使用<a>
標籤,並沒有提及任何有關<%= link_to %>
標籤的內容。這就是Bootstrap文檔的<a class="btn btn-large btn-danger" href="#">Download Now</a>
中列出的內容,其中「立即下載」是按鈕上的文本顯示。
任何幫助表示讚賞。
它只是作爲普通的論據之一。用您的pdf文檔路徑替換#的href =「#」。 – happy
你只是建立一個這樣的鏈接:'<%= link_to download_path,:class =>「btn btn-large btn-danger」do%>立即下載<% end %>' –