Week 5, Monday

April 20, 2009 at 9:37 pm (Ruby, Week 5) (, , )

Long day today: we closed out basically all of the outstanding bugs in our Rails application, and we’re going to be launching publicly soon. There are a few styling and wording tweaks left, but the actual bugs and other big things are all done. I ran across a problem with RESTful routing in Rails that somehow I hadn’t encountered before. I know that on an edit form, you generally need something along the lines of :html => { :method => :put } since browsers don’t really do PUT requests, at least not yet (it inserts a hidden _method input with value “put”). This was working great to direct the form submittal to the :update action, but we also had an observe_field that needed to submit to a different action (for a live-preview AJAX request). It turned out that the observe_field was trying to submit to the :update action as well. I have a feeling there’s a “Rails way” around this dilemma, but I ended up just changing the :update action to be a straight POST request (no PUT), adding a :member => {:update => :post} route to handle it, and things are going swimmingly now.

Paul and I stuck around late to do some styling tweaks, and I think we’ve got something presentable, though there are still some improvements to be made. Launching early and often is exciting: we’ve gotten so much done in just three weeks on this project!

Micah and I had a one-month retrospective on my apprenticeship, covering the things that were going well, the things that weren’t going as well, and the things that should change. We think that in general, things are going very well. I mentioned that while I’ve come a long way with TDD and RSpec, that part of my programming is definitely weak. It kind of ends up falling into the “good” column, since I’ve progressed so much, but I have a long way to go to make it as strong of a habit as the other 8th Lighters. It sounds like there’s another, tougher project on the horizon once I finish Tic-Tac-Toe. Micah says the big things left for my Tic-Tac-Toe game are caching of the board scores (my HashTable) and then a code review with him. I’m pretty confident in my ability to get the HashTable working properly, but I know that the code review is going to show me some weak spots. I’m definitely going to need to take a few passes through the codebase to refactor and add tests where I can. I feel certain that I’m going to spot a lot of bad things, since I started this project three weeks ago, and I’ve come so far since then. It makes me a little apprehensive, but I have to remember this talk from David Heinemeier-Hansson. Key thoughts: “The software doesn’t change… you got smarter… you learned more… When that tomato went from great to rotten, that was a process in you, where you improved.” Inspiring and happy thoughts.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: