Closed mesosteros closed 8 years ago
@mesosteros that has to do with the builtin CSRF protection in Phoenix. You'll have to inject the CSRF header on the ajax request, check the accepted answer here, or... you could also skip it on your routes, but don't quote me on that :stuck_out_tongue:
I already tried that. And in the example you provide you don't use <form>
.
By the way, I'm not getting the error anymore but nothing happens now (I wasn't using the jquery-ujs because I was asked not to). The problem is that nothing is being saved on the database or sent to my email.
@mesosteros but does the request reach the server?
I don't know now. With the CSRF error it was because the message also displayed in the server. But now without the error no feedback is being given.
@mesosteros I've added a quick guide to have the layouts and controllers work out of the box here. In case you need to use CSRF Tokens for the templates you can also use this configuration.
Closing the issue for now, feel free to re-open in case the issue persists.
Ok, I have the everything up and running until the forms (also following the example you provide). When I click the buttons to submit a request I get a CSRF error.
On the browser console it says:
And also:
On my console I have: