If you’re missing a table when running the test suite, it’s probably an indication that you need to run
rake db:test:prepare
I’m going to love start hacking away with this magic called Rails.
I’ve done web development and one area that stinks is keeping track of links. It really stinks when months pass and code is changed that affects the link format.
When dealing with SEO, I also had to deal with URL rewriting. I’d use ISAPI rewriters or mod_rewrite to make inbound links pretty. I never got deep in what else those rewriters could do, so I set it up and moved on. Set it and forget it.
I’m two weeks into Code Academy and we got deeper into routes.rb. I definitely had an A-Ha moment since it is such an elegant way to do things.
The Rails URLs already look good so there was need to muck around with rewrite conditions.
Instead of this in mod_rewrite:
RewriteRule ^products/([0-9]+)/?$ show_a_landmark.php?landmark_id=$1 [NC,L] # Handle product requests
All I had to write was this line in routes.rb:
get 'landmarks/:id/show' => 'landmarks#show'
I was actually excited since the syntax was straightforward. What made my day was that it not only worked to process incoming URLs, but also to format outgoing URLs.
Using the link_to tag seemed cleaned, but I started noticing the rendered links to change as I modified routes.rb. I loved the fact that I didn’t have to change any code to render out anchor links in my views.
Changing:
get 'landmarks/:id/show' => 'landmarks#show' # produces http://localhost:3000/landmarks/2/show href values
To:
get 'landmarks/show/:id' => 'landmarks#show' # produces http://localhost:3000/landmarks/show/2 href values
To:
get 'landmarks/show' => 'landmarks#show' # produces http://localhost:3000/landmarks/show?id=2 href values
produced some elegant stuff. I know I’m just scratching the surface, but this helps me focus on building versus being worried on how painful maintenance would be.
Good stuff!
I’m coming into Code Academy with a mishmash of web development experience. My first internship was at a financial publishing company a long time ago. How far back? A small company dot-com called Amazon didn’t IPO yet.
For two and a half months, I was supposed to read the company’s digital content and assist with editing. That’s it. Look at articles about the banking industry and try not to snooze on the job.
My boss was part-time, but her boss, the CTO, summoned me to his office a week into the internship. He thought the internet was cool and asked if I wanted to try to build something for the web. There was already a CD-installed windows program that just launched. A department was devoted to burning CDs and physically mailing them out to banks around the world. They did this every month. Back then, this was replacing actually printing out Encyclopedia-style volumes of this data so it was definitely progress.
I was a bit clueless at the time. I agreed on the summer challenge without knowing where to start. As they say, “Ignorance is bliss.”
I did have the benefit of being an intern (what could I lose) and having a part-time boss. So, I hung out at the Barnes & Noble and tried to read whatever had the word web on it. I was two years too early for Philip & Alex’s Guide to Web Publishing.
I had four weeks to show a prototype. I played around (i.e. struggled) with Java after looking it for 2 hours. Perl came in the picture. Microsoft Access was the db. Looking back, I have no clue how I paired those together, but it had to have been an ODBC Connector on the server. It was ghetto, but with some HTML lipstick, it was great showing off the project to the executive team. I was happy that it got funded and the product is still alive today. Fortunately, it’s still not running Perl and Microsoft Access. Oh yeah, I got a full-time job offer at the end of my internship.
How does this relate to Code Academy?
I’m nostalgic. I want to carve out time for that summer intern still in me. Give him a timeline and let him rip something out. It’s been too easy for me to buy a book and dog ear it up to Chapter 2. I saw 12 weeks. I saw Ruby on Rails. I saw Chicago. I was sold. Everyone needs a catalyst every now and then.
One week down. 11 weeks to go. The summer intern is waking back up.
Ever since I was a kid, I’d look at something and feel confident enough to do it. I’d bypass instructions, ignore the teacher, and make quick assumptions of how I’d do things. Sadly, this lead to massive failures even as a 8 year old. In my mind at the time, the biggest was at Noah’s Ark in Wisconsin. My cousin and I jumped into bumper boats and I saw a single bicycle handlebar grip staring at me. That’s it. No pedals, no levers, nothing else. Easy. My cousin was getting full instructions of how to use it. When the park employee came to me, I brushed him off. Let’s just get this thing moving.

In hindsight, I could’ve predicted my next three minutes. 11 bumper boats were bumping and boating in the middle of the large pool. Bumper Boat #12? Yes, that was me in the corner spinning around slowly. I couldn’t figure out how to accelerate, go straight, or even stop. I was stuck in this gear that Amigo Carts also have at your local Target.
The last two minutes were spent being yelled at by the park employee. With the use of the pool wall, I was able to make a slow, but somewhat straight line back to the group. My cousin was laughing hysterically at my lameness and I wanted to hastily go back the next day so I could firebomb the water ride.
Fast forward to now. I look at my action of prematurely understanding something as a fun quirk. I definitely don’t wait to fill in the blanks on issues. I also avoid analysis paralysis, which keeps things moving along in life. I could label it “following my gut.”
The good thing with age is that you build a thicker skin. I don’t feel the need to firebomb anything if I screw up. I like people laughing… even at my expense. After skimming through all these business books, you learn to fail and build upon those experiences for the go around. I’m not a doctor or airline pilot, so I can make mistakes.
So, here goes my blog. I haven’t had a personal blog since 2001, but this will be a good journal of things for my time at Code Academy. What’s Code Academy? It’s a new development program in Chicago that I decided to try out. I’ll learn some Rails. While on Rails, I’ll learn some Ruby. The biggest part is the mashup of ideas, timelines, collaboration and community. I’ve got some ideas. I have a timeline (end of March). I’ll dive into the community soon!