Form closed without updating database table - ruby ​​on rails

I have a popup form that allows the user to submit information. I want the modal to close after users submit requests. It does close, but does not send anything to the database. Here's the code

.form-actions#submitButton
            = f.button :submit, class: "btn btn-lg btn-success btn-primary col-sm-offset-5"

 :javascript
   $('#submitButton').click(function() {
     $('#landslide-submit-modal').modal('hide');
   });

      

+3


source to share


3 answers


Thanks guys. The problem was the indentation. Fixed.



+2


source


Make sure you specify which model this form is for, then the rails will know where to submit the entry.



0


source


Change the function and try with:

$('#submitButton').click(function() {
  $('#landslide-submit-modal').modal('hide');
  return false;
});

      

0


source







All Articles