我有simple_form_for元素的新页面如下图所示多个HTML属性Simple_form_for
<%= simple_form_for @invoice, :html => { :class => 'form-horizontal' } do |f| %>
<%= render "shared/error_messages", :target => @invoice %>
<%= f.association :customer %>
<%= f.input :invoice_date, as: :string, input_html: { class: "datepicker"} %>
<% end %>
我试图日历元素纳入上述表单,从unicorm管理模板主题。 我的资产文件包含bootstrap-datepicker.js,我试图将其纳入上述表单中。 每当我为invoice_date输入添加额外的HTML属性时,我都会收到一个syntaxt错误。
我想这
<%= f.input :invoice_date, as: :string, input_html: { class: "datepicker", data-date-format="dd-mm-yyyy"} %>
其产生的误差。如何将日历功能并入我的模板中的bootstrap-datepicker.js以上的invoice_date?