def self.filter_price(direction, price)
    return nil if direction.blank? or price.blank?
    return {:error => 'Invalid argument: direction'} unless ['at most', 'at least'].include? direction
...

Ruby DRYing/shortening form proc...

by Nick, October 24, 2008 20:03, 2 refactorings, tagged with process rails form

In my Rails app, the Proper...

49de4cd2f26705785cbef2b15a9df7aa Talk