【发布时间】:2014-03-10 12:42:51
【问题描述】:
您好,cocoon 有问题:https://github.com/nathanvda/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
有什么想法吗?
【问题讨论】:
标签: javascript jquery ruby-on-rails ruby-on-rails-4 cocoon-gem