convert to rails 4
update for rails 4