javascript - Rails data-remote attribute not always requesting a JS response -
i have form_for
remote: :true
, problem seems submitted remotely half of time. actioncontroller::unknownformat (actioncontroller::unknownformat)
error server, configured respond format.js
, , of time form work perfectly.
is there way can call $.rails
make sure data-remote binding taking effect? have turbolinks turned off. here code form:
= form_for [:admin, @seating_chart], remote: 'true', authenticity_token: true, multipart: true |f| %br .form-group.text-center = f.label :name = f.text_field :name, class: 'form-control' .form-group.text-center = f.label :venue_id = f.collection_select :venue_id, venue.all, :id, :name .form-group.text-center = f.label :chart_image = f.file_field :chart_image, id: :seating_chart_file .actions.text-center = f.submit 'save', class: 'btn btn-primary' \| = link_to 'back', :back, class: 'btn btn-primary'
edit: upon further investigation seems happen when upload image - if don't upload image error doesn't occur.
since trying upload file ajax request can't achieved directly. solution case remotipart
and demo of it
Comments
Post a Comment