[V5] Rails3.0 porting with mix of old and new format route

rebased #786.