我决定不使用turbolinks,因为他与一些javascript库发生了冲突,但删除后却没有提交表单。
在我使用application.js
和rake assets:clobber
rake assets:precompile
的turbolinks
的application.js
//= require jquery_ujs
//= require_tree .
_footer.html.erb
<!-- BEGIN CORE JS FRAMEWORK-->
<%= javascript_include_tag '/assets/jquery-1.8.3.min' %>
<!-- Others Javascript libraries here -->
<!-- END CORE JS FRAMEWORK -->
<%= javascript_include_tag 'application' %>
_form.html.erb
<%= form_for(@passenger, html: { class: 'form-no-horizontal-spacing', id: 'form-condensed' }) do |f| %>
<%= f.text_field :passenger_name, class: 'form-control', placeholder: 'Nome', required: true %>
<%= f.email_field :passenger_email, class: 'form-control', placeholder: 'Email', required: true %>
<%= f.text_field :passenger_phone, class: 'form-control', placeholder: 'Telefone' %>
<%= f.text_field :passenger_birthday, class: 'form-control', placeholder: 'Data de Nasc.', required: true %>
<%= f.text_field :passenger_cpf, class: 'form-control', placeholder: 'CPF', required: true %>
<%= f.text_field :passenger_address, class: 'form-control', placeholder: 'Endereço' %>
<%= f.text_field :responsible_name, class: 'form-control', placeholder: 'Nome do responsável', required: true %>
<%= f.email_field :responsible_email, class: 'form-control', placeholder: 'Email do responsável' %>
<%= f.text_field :responsible_cpf, class: 'form-control', placeholder: 'CPF do responsável' %>
<%= f.text_field :responsible_phone, class: 'form-control', placeholder: 'Telefone do responsável', required: true %>
<%= f.submit 'Salvar', class: 'btn btn-danger btn-cons' %>
<% end %>
加载Javascript的打印屏幕:
我删除了turbolinks后,我无法提交表格。
有谁知道为什么?