How To Set Up Devise AJAX Authentication With Rails 4.0

For whatever reason, there are several blog posts on how to accomplish this, and they all get it completely wrong. If you've found this page, I sincerely hope you haven't had to experience those. Learn from my pain. Devise can almost do this out of the box. We just have…