[V19] Rails3.0 porting without default route

rebased #655 and #656.