https://github.com/nathanvda/cocoon
嗨 cocoon:和 datetimepicker有问题:http://xdsoft.net/jqplugins/datetimepicker/
。当我通过茧新的嵌套字段添加时,我的日历没有显示。我认为我必须在我的javascript文件中插入事件之后使用茧,但我尝试了各种方法,但这是行不通的。这是我的观点:cost.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
有任何想法吗?