Articles in the Code Category
Code, Headline »
I was just reminded how much I have learned about Ruby metaprogramming in just the past few months when I looked back at the original code I wrote for the soundex_find plugin. The code worked great, but relied on excessive eval calls.
Read the full story »Code »
LightWindow is one of the better modal windows available for the Prototype/Scriptaculous environment. It looks great, has excellent browser compatibility, and works with many kinds of content. However, I ran into a situation that required a few tweaks to get LightWindow to work on all current browsers.
Read the full story »Code, Headline »
Railroad is a great tool to to help document your Rails projects. It automatically creates class diagrams for Model relationships and Controller relationships in DOT format. With Graphviz installed, you can automatically generate nice looking SVG or PNG diagrams. Even better, Roy Wright has improved the original to work with both Rails and Merb projects. However, when I tried to use Railroad with a Rails 2.3 project, it suddenly couldn’t find my controller files.
Read the full story »Code, Featured »
Wouldn’t it be nice to have an auto-complete that includes phonetically similar results? And what if the same code also handled misspellings in search forms, played nice with other ActiveRecord plugins, and could be configured to varying levels of strictness?
I’ve used this code over a few projects, and originally developed it based on a Ruby Soundex function provided by Alexander Ermolaev at snippets.dzone.com. The original algorithm requires a full-length match, so it is not suitable for auto-complete. I also thought it would be nice to support fuzzy full-text search, and arbitrary match lengths.
Read the full story »Code, Featured »
If you manage more than one domain on an IP address, you are probably using Apache name-based VirtualHost sections to send incoming requests to the correct application handlers. What you may not realize is that an improperly configured VirtualHost setup can cause serious Search Engine Optimization (SEO) problems, even if everything appears to be working perfectly.
Read the full story »
