generates urls correctly under rails 4