I create the form in this way:
= form_for Review.new do |f|
= react_component "Popups/ReviewPopup", {name: "review-popup"}
Inside the Popup/PreviewPopup
I have a form field with the desired name
.
And when click on the submit occurs:
const SendButton = ({ onSubmit }) => (
<button
onSubmit={e => {
e.preventDefault();
onSubmit(e);
}}
className="button popup-footer__button"
>
Send
</button>
);
After that, without rebooting, data from the form should be sent and the message should appear in the browser.
During a normal send everything works perfectly.
How to implement remote: true
? I want to implement a remote: true
and not to catch data from fields when the user click and send them using the axios
to the server.