I was in the middle of completely overhauling some backend code, while attempting to reuse as much as possible of the semi-complex frontend. The form and js were basically the same, but I had to do some minor modifications to make it jive with the new ActiveRecord model that was backing it.
Anyway, I clicked the submit button on my form, expecting to watch the dev log for my incoming request, expecting to verify that my input params were correct, expecting to see something. But I didn't.
In the browser there was a flash message with an error. That means there was definitely a request. But nothing in the dev log. How does that happen?
I checked the Network tab in the Chrome dev tools. There it was, a 500. Looking at the response, I could see the problem...
It had blown up in rack, not even making it to the Rails app. That explained why there was nothing in the dev log.
It was complaining about the
source input, but what was the problem? I double-checked the input name...
<input name="source" type="text">
...made sure that it was the right format to return an array. It was. What the hell was going on? Finally, after searching through the view template, I realized the problem. There was another input - a hidden one, with the same name.
<input name="source" type="hidden">
That was it. Two inputs, both named "source". One a string, and the other an array. Fuck me.
I renamed one of the inputs, and BOOM, everything worked. Life goes on.