Rails.js XHR form callbacks fixed for invalid submissions

I struggled with Ajax form calls in Ruby on Rails for some time now. Because I seem to be anal retentive, I insist the server should respond with HTTP status code “400 Bad Request” or “424 Unprocessable Entity” when form submission turns out to be full with invalid data. Responding with “200 OK” doesn’t make any sense when there was an error on the client side, like an empty or otherwise invalid form. That’s what HTTP codes are for: to comminicate how it went and what happened. Also, we web developers are creating publicly visible Web Services and APIs here, so they should conform to the most basic standards of the transfer protocol we’re using, am I right?

Continue reading …

Birthday of my deceased baby brother

Exactly one year ago, my baby brother was born. I was raised to adulthood an only child. Naturally, I got really excited about the birth of my little brother. I imagined how we would play and what we could do together, me being 25 years above his age. I asked myself seemingly adult questions, too: what would I be able to pass on to him? How could I contribute to his upbringing?

Continue reading …