我切換到Twitter的引導2.1.1。Twitter的引導模式軌道刪除按鈕不工作
我有一個模式與一個按鈕可以刪除,但它不能正常工作。在以前的引導版本中,它工作正常。 Rails的版本是3.1
下面是代碼
<a title="<%= t('delete') %>" id="delete" class="label" href="#myModal-<%= post.id %>" data-toggle="modal"><%= t('delete') %></a>
模態
<div class="modal hide" id="myModal-<%= post.id %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"><%= t('delete_this_question') %></h3>
</div>
<div class="modal-body">
<p><%= raw post.text %></p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><%= t('cancel') %></button>
<%= link_to(t('delete'), { :controller => 'posts', :action => 'destroy', :id => post.id } ,:method => :delete, :class => 'btn btn-primary') %>
</div>
</div>
但它不工作。 Rails接收GET並顯示帖子,但它不會將其銷燬。
有什麼想法?由於
嘗試post_path(後)和檢查 – Amar
感謝您的回覆@A三月 我試過這個 <%= link_to(t('delete'),post_path(post),:class =>'btn btn-primary')%> 但不起作用 – jferrercas
檢查必要的javascripts(屬於bootstrap框架)在你生成的html中。 – inntran