Making it work with rails 4