Ugh, AJAX. Why must you be so cruel?

I started the day excited about the possibility of UJS, but that dream was quickly squashed this morning during our lecture. My teacher walked us through UJS and how to use it, but then explained why it would not be best practice, since it’s not heavily used in the industry and it doesn’t separate concerns out very well.

We spent quite a while in the lecture, which goes to show the minute details that go into AJAX calls in Rails. We only had about 30 minutes to work before lunch, but during that time we learned about Handlebars, which again caused me frustration. I was excited to learn about it, but the T.A. who told me about it said he’d learned it during his Phase 2, which tells me that we’re not all getting the same education.

Handlebars, as far as I can tell, lets you take the data from an AJAX call and format it exactly as you want. The object that comes back is very similar to a partial, if you’re familiar with what that is in Rails. Handlebars just lets you implement that partial in an easier way.

Lunch, then lecture on the Asset Pipeline. Not much to speak of here, basically the ‘Public’ folder where our images, CSS, and JS files should live. The Assets folder is a little smarter, though, because it has a file that’s already linked to Rails and looks for other files in the same folder to link.

Between lecture and EOD, we were only able to get through two parts of the AJAX challenge. We could post new questions and new answers to their respective pages asynchronously, but weren’t able to tackle adding asynchronous upvoting and downvoting. Something for tomorrow, I guess.

I went home and spent a couple hours on Firebase, which I have to give a short talk on next week. It seems incredibly easy to implement, but I’m going to play with it this weekend.

Until tomorrow, I’m Edwin Unger and I’m a web developer in training.