Making it work in Rails 4