Handling nil: Trying to avoid #try
I introduced a bug into our codebase by calling #titleize on a string that could possibly come in as nil


When a problem is so pervasive, it's usually a sign that there is a conceptual problem with the language itself, some call it void safety, also dubbed "the billion-dollar mistake". Some languages, specially the functional ones, use an Option type. Let's see the options in Ruby:


medication.route_name.try(:titleize). This is probably the most idiomatic approach in Rails. You say you're not totally happy, yes, it's ugly that a method name ended up being a symbol. Note, however, that if you want an empty string as fallback, you should write medication.route_name.try(:titleize) || "". 
Very similar to try, I prefer the proxy approach of andand/maybe: medication.route_name.maybe.titleize || "". 
medication.route_name.to_s.titleize. IMO, that's dubious. You are calling to_s to a nil object. Yes, it happens to return "", but it could as well return "nil" (see for example Python: str(None) #=&gt; 'None'). Too implicit.
medication.route_name.present? medication.route_name.titleize : ''. You are protecting yourself against nil objects, not empty strings, so there is no need to use present?: medication.route_name ? medication.route_name.titleize : ''. As you say, this is simple but verbose. Also, imagine you have a chain of  nullable values, it becomes a real mess. That's why andand and similar libraries were created.


By the way, I've wrote about this subject at RubyIdioms.