我正在將應用程序從Rails 2遷移到Rails 3. 我們有多個命名空間不同的命名空間的控制器。 因爲他們不是RESTfull我不想使用資源路由,而是我想有一箇舊的Rails 2,如匹配':controller /:action',它拿起命名空間控制器。 在我的routes.rb我有 # Install the default route as the lowest priority.
mat
我偶爾會在日誌文件中看到這樣的錯誤,我該如何處理。 Started GET "/w00tw00t.at.ISC.SANS.Win32:)" for 69.25.37.166 at 2013-01-02 00:06:05 +0000
ActionController::RoutingError (No route matches [GET] "/w00tw00t.at.ISC.SANS.Win3
我想要獲得更好的Rail的嵌套資源句柄,並且使用模型School和類作了測試應用。在我routes.rb文件,我有: resources :schools do
resources :classes
end
隨着學校和級以下車型的關係: class School < ActiveRecord::Base
attr_accessible: name
has_man
開始學習Rails幾個小時後使用Agile Web Development with Rails這本書,並立即打開了一個障礙。 創建使用名爲說控制器: rails generate controller Say hello goodbye 然後我試圖打URL http://localhost:3000/Say/hello但它說: No route matches [GET] "/Say/hello
在Rails 3.2.11,我有以下路由定義 resources :foos do
resources :bars
resources :bangs, :controller => 'foos/bangs'
end
這導致以下路線 foo_bars GET /foos/:foo_id/bars(.:format) bars#index
POST /f
我按照本教程中的討論 - http://www.slideshare.net/wleeper/devise-and-railsupto page 8 of 22,並且我期待着與頁面上提到的相同的用戶登錄表單8,但除了這個,我得到這個錯誤 - 如果我保留意見,因爲它是對的routes.rb文件, #匹配「:控制器(/:動作(/:ID)) (。:format)' then this message f
我看到類似的Rails應用程序如下: Application.routes.draw do
root :to => "accounts#index"
end
我告訴here,這將確定其中軌道路線,如果「/」是問路。然而,這裏的heck是在Rails代碼中定義的這個「根」函數?我不明白涉及哪些範圍問題才能使此技巧發揮作用。 我可以看到一個塊正在傳遞給draw函數。所以我假設draw函