Custom Validations in Rails

Rails validations are nifty, but they can get pretty bulky and difficult to read. In this article we’ll look at how to counteract the bulk with custom validations that enable the use of class methods with clearer names like validates_as_person_name.

Read more »

Using Subdomains in Rails Apps

This article will show you how to use URLs like http://photosByBetty.fancysite.com instead of http://www.fancysite.com/artists/photosByBetty in your Rails application.

Examples of where you might want to do this include blogs for site members, galleries for artists, chapters of a non-profit organization, teams of a sports league, or even different retail locations for a store. Using subdomains for these types of site delineations allows URLs to be shorter and have a more professional appeal. Taken further, it can also provide an opportunity to to make each subdomain site look customized while running from the same application code. Read more »

Compiling mysql-ruby for PowerPC

Mind boggling as it is, I could not find any instructions for how to compile mysql-ruby that actually worked. I'm no C geek, but with a little here, a little there, and applying 25 years of engineering in various fields and disciplines... I guessed, and managed to hack out some fixes that seem to be working.

It turns out the problem, as it appears to my untrained eye, is that the mysql-ruby libraries assume the use of an intel-based Mac. I am using a G5 (woe is me). So, these instruction are aimed specifically at users of G5, and presumably any PowerPC, Mac OS X machines. Read more »

Modular Page Assembly in Rails

Downloads:
10 page pdf article only or article and sample code.

So, you've read “Agile Web Development with Rails”, and you've started to tinker with some pages on your own, but you just can't figure out how you're supposed to use that view file to create your 3 column layout?

So far I’ve found every tutorial on Rails talks about the default chain of controller to view to layout and stops. 3 files, done. Well, then what?

I felt your pain. So, I've prepared an article and sample code set (links up top) intended to pick up where AWDWR leaves off in explaining how to organize files for a modular page assemby approach with layouts and partials. Read more »