I have such lines in routes.rb:
scope \"/:subdomain/\" do resource :order, :only => [:new, :create, :show, :update, :edit, :destroy] do get :cance
The answer is "use () and defaults"
scope "/(:subdomain)", :defaults => {:subdomain => "default"} do ... end
http://guides.rubyonrails.org/routing.html#dynamic-segments and http://guides.rubyonrails.org/routing.html#defining-defaults