Form Submit button only works after reload

前端 未结 6 1373

I have an index page that builds a table, and I am trying to allow users to edit line\'s in the table. I am trying to do this in the most basic way possible - no javascript

6条回答
  •  暖寄归人
    2020-11-29 09:59

    I have to share my experience : I played with Turbolinks, like you. But suddently, I had an issue : the previous pages needed to have turbolinks disabled too, to work. After many & many & many hours on the issue, I found the solution : <% f.submit %> was separated by 2

    from the rest of the form ! Here is an example: Wrong:

    Modifier une marque
    <%= form_for @brand, url: {action: "update"} do |f| %>
    <%= f.text_field :brand, class: "contact_input" %>
    <%= f.label "Image de la marque" %>
    <%= f.file_field :brand_picture %>
    <% end %>

    Correct:

       
    Modifier une marque
    <%= form_for @brand, url: {action: "update"} do |f| %>
    <%= f.text_field :brand, class: "contact_input" %>
    <%= f.label "Image de la marque" %>
    <%= f.file_field :brand_picture %>
    <% end %>

提交回复
热议问题