tested with rails 3