I have a partial form I’m using on an app with ajax. The validation warnings worked well previously (You miss a required field, it tells you there was a problem and with what field). Then I decided to enhance the app with ajax. I use the partial form with javascript for an edit action in the index view. I also use the partial form in html for new.html.erb.
But after configuring for ajax, neither the edit action nor the new action will display validation errors. They just won’t take the change, give no explanation. If I then add the missing field, it is created/updated and I get the notice that it was created/updated successfully. I’m stumped.
This is the form partial:
This is the controller:
This the edit.js.erb file:
https://github.com/DrewAPeterson7671/favorite-cocktails/blob/master/app/views/cocktails/edit.js.erb
I have read a lot of articles and most of them seem to resolve with the controller action needing “render :new”. But that’s not solving it for me.
Thanks!