我想在rails項目上實現引導模式。它工作正常,但我的datepicker不在模態內工作。在我的索引文件,我已經在在app /視圖/產品/ search_products.js.erb以下Datepicker不能使用引導模式
<%= link_to "search_products", search_products_path, remote: true, "data-toggle" => "modal",
'data-target' => '#search-products' %>
<div class="modal fade" id="search-products" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content"></div>
</div>
</div>
然後,我有
$("#search-products").html("<%= escape_javascript(render 'products/search_product')
%>")
而且裏面的 'search_product' 部分,
<%= text_field_tag :date_purchased, type: "text", placeholder: t('click_here'),
class: "form-control date_picker" %>
我正在使用rails4 datepicker不是來自bootstrap,而是在我的應用程序的非模態頁面中正常工作。如果有人能告訴我我做錯了什麼,我將不勝感激。
感謝
我的問題不清楚或不夠有趣,值得回答嗎? :-) – Tiamon 2014-10-16 10:58:26