Hi everyone I stuck on that mission and I can’t figure out the right way to do this.
(method: :patch or post ) I can’t figure how to build the correct pattern to include a form for that objet and also to store the attribute inside my DB.
I would like to store a cellphone number through a form inside the sweetalert.
For instance here where I am
for Webpack component
import Rails from 'rails-ujs';
import swal from 'sweetalert';
import 'swal-forms/swal-forms.js';
import 'swal-forms/swal-forms.css';
my current code
$('#btn-submit').on('click',function(e){
e.preventDefault();
var form = $(this).parents('form');
swal.withForm({
title: 'Cool Swal-Forms example',
content: {
element: "input",
attributes: {
placeholder: "Type your password",
type: "password",
},
},
buttons: ["foo", "bar"],
icon: "success",
closeModal: true,
formFields: [
{ id: 'name', placeholder:'Name Field', required: true }
]
})
});
(method: :delete ) I’m able to delete (method: :delete ) any kind of object with Sweetalert / rails / webpack if some of you need help about delete methode ROR Sweetalert Weback my solution works let me know .