Human-Readable ActiveResource URLs
Code: ActiveResource, design, human-readable, named routes, nested routes, Rails, Rails 1.1, Rails 1.2, RESTful, routes, URLs
I’ve got URLs on the brain this week. I started NearbyGamers using Rails 1.1 with just gamers and tags. I upgraded to Rails 1.2 (and liked it)
, and added discussions after I updated to Rails 1.2. I was able to use ActiveResource for Discussions with Posts as a nested resource. I’m really happy with this code, as it’s very tidy.
It’s very easy for a site’s CSS to grow a single giant, brittle stylesheet. It becomes impossible to change anything because of bizarre interactions between elements, unexpected interactions, and simply because it’s just too big for anyone to understand. Much of programming is managing complexity, and I’ll share a nice technique in that vein.
It’s easy for socks to go missing, and it’s annoying to have to match up socks. My girlfriend and I have developed two entirely different strategies for dealing with these eventualities.
I love shoving around large amounts of data. Unicode is an industry standard for encoding data in most every written script there’s ever been. It has over 97,000 characters. A while ago I read about a guy who made his own Unicode poster and I realized I had an opportunity for a fun project. I think Unicode is an invaluable and beautiful project, and this is my tribute to it.
Last night at the June 2006 ChiPy meeting I gave a presentation on how I wrote a few small Python scripts to take apart the Unicode PDF of all its glyphs and recombine them into giant ascii-art-like posters.
As an aside in my post about Cambrian House I posted some code for making pretty URLs. A few people (no, not CH) have asked for a little more info, so I’ve written up an explanation of that code.
I just read a good post on Gadetopia about writing skills and had a small correction to offer. Go read it and come back (and read the two linked posts about Word and Frontpage use). I’ll wait.
I’m reading Programming Ruby: 2nd Ed. and an example on page 57 has captured my attention. (Code slightly modified for brevity)