我正在使用 rails 5、gem 'cocoon' 和 'twitter-bootstrap-rails' v.4.0.0。我想在“洗掉”下方用引導垃圾箱圖示交換 link_to_remove_association。
<%= link_to_remove_association "Delete", f, class: 'btn btn-danger' %>
<%= link_to_remove_association, f, do %>
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
<% end %>
我如上嘗試,但語法錯誤顯示:
“語法錯誤,意外的keyword_do_block ...nk_to_remove_association,f,做@output_buffer.safe_append='... ... ^~ 語法錯誤,意外的keyword_ensure,期望輸入結束確保^~~~~~”
我應該如何正確書寫?
uj5u.com熱心網友回復:
我可以解決這個問題:
<%= link_to_remove_association '<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>'.html_safe, f, class: 'btn btn-danger' %>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/384611.html
