2015-10-30 46 views
8

Mam następujące szyny3 trasy, które chcę przekonwertować na rails4.Jak przekonwertować trasy rails3 na rails4

map.with_options(:conditions => {:subdomain => AppConfig['admin_subdomain']}) do |subdom| 
    subdom.root :controller => 'subscription_admin/subscriptions', :action => 'index' 
    subdom.with_options(:namespace => 'subscription_admin/', :name_prefix => 'admin_', :path_prefix => nil) do |admin| 
    ... 
    end 
end 

Odpowiedz

1
namespace :admin do 
    constraints subdomain: AppConfig['admin_subdomain'] do 
    root to: 'subscription_admin/subscriptions#index' 
    namespace :subscription_admin do 
     resources :some_resources 
     # RESTful routes 
     end 
    end 
    end 
end 

More info about constrains.

+0

poddomena ograniczeń: AppConfig ['admin_subdomain'] –