use rails 3 method instead of rails 4