Hi everyone! A few days I can't resolve a task. I want to build a single page app without any page refresh. So I have a button 'Add', onclick it inserts in a DOM a simple remote:true form and when I try to submit this form - nothing happens BUT if i refresh the page - it works. Guess some handler is absent but not sure. Advise please. Here's my form <%= form_tag(:add_task, method: 'post', remote: true) do %> <td> <span class="glyphicon glyphicon-plus"></span> </td> <td> <%= text_field(:task,:project_id,type: 'hidden',value: @project.id)%> <%= text_field(:task,:name,class: 'form-control task_field', placeholder: 'Start typing here to create a task...')%> </td> <td> <%= button_tag('Add task',class:'btn btn-add_task') %> </td> <% end %>
The first thing to do is to look in development.log and see if it submitting correctly.
Colin
already checked. nothing written in the log
When replying please quote the previous message, this is is a mailing list not a forum (though you may be using it via a forum like interface). If you don't we have to look back through previous messages to find what you are replying to.
I presume that you mean that when you press the button absolutely nothing happens at the server. In that case your submit button is not working.
I notice that you seem to have a form that is a single row in a table, that is not valid html. A form can wrap a complete table or exist within a cell, but not wrap part of a table. That may or may not be the problem you are seeing, but you must fix that first. Even if it appeared to work it may not work in a different browser or a different version of the same browser.
Colin
Colin Law wrote in post #1181667: