2013-05-03 118 views
0

我正在從ruby 2.3.xx更新應用程序到3.2,我每次都在做一步。rails 3中的默認路徑3

應用程序使用從賴斯2.3.xx的缺省路由的描述如下:

# Install the default route as the lowest priority. 
map.connect ':controller/:action/:id.:format' 
map.connect ':controller/:action/:id' 
map.connect ':controller/:action.:format' 
map.connect ':controller.:format' 

當然,你不希望有這樣的路線對你的Rails 3應用程序,但由於更新過程中,我想要做小步驟。所以第一步就是讓這些路線工作,然後消除它。

所以,問題:如何在軌道3中寫這條路線?

回答

1

從Rails的3 config/routes.rb

# This is a legacy wild controller route that's not recommended for RESTful applications. 
# Note: This route will make all actions in every controller accessible via GET requests. 
# match ':controller(/:action(/:id))(.:format)' 
+0

duhh。謝謝。 – fotanus 2013-05-03 20:33:41

+0

當然,它有最少的時間來接受答案。 – fotanus 2013-05-03 20:40:30

+0

意外刪除了我的評論,但正確的是您的時間限制爲15分鐘:http://meta.stackexchange.com/questions/50697/time-limit-on-accepting-an-answer – zeantsoi 2013-05-03 20:52:15