Fix form url generation for named route.

Fixes #4492