こんにちは、 cocoon:https://github.com/nathanvda/cocoon
と datetimepickerに問題があり:http://xdsoft.net/jqplugins/datetimepicker/
ます。cocoon の新しいネストされたフィールドを追加すると、カレンダーが表示されません。javascript ファイルで cocoon after:insert イベントを使用する必要があると思いますが、すべての方法を試しましたが、うまくいきません。これは私の見解です:costs.html.haml
= simple_form_for [:partners, @car], url: wizard_path do |f|
= f.simple_fields_for :costs do |cost|
= render 'cost_fields', f: cost
#links
= link_to_add_association '+', f, :costs
= link_to t('cars.back'), previous_wizard_path
= f.submit t('cars.next'), class: 'btn btn-primary'
そして私の cost_fields パーシャル:
.nested-fields
%table.table.table-striped.table-bordered.dupa
%thead
%th.field
= f.association :cost_type
%th.field
= f.input :netto_price
%th.field
= f.input :document_number
%th.field
= f.association :vat
%th.field
= f.input :type_of_cost
%th.field
= f.input :date, as: :string , :input_html => { :class => 'date' }
= link_to_remove_association "X", f
何か案は?