Make it work with rails 4