3
我檢查了通常的拼寫錯誤或文件在錯誤的地方。毫無疑問,這將是一件簡單的事情 - 但我看不到它。我錯過了什麼?ActionController :: RoutingError(未初始化的<控制器名稱)
控制器/管理/ top_10_pages_controller.rb
class Admin::Top10PagesController < Admin::AdminController
end
模型/ top_10_page.rb
class Top10Page < ActiveRecord::Base
end
的routes.rb
namespace :admin do
resources :top_10_pages
end
耙路由
admin_top_10_pages GET /admin/top_10_pages admin/top_10_pages#index
POST /admin/top_10_pages admin/top_10_pages#create
new_admin_top_10_page GET /admin/top_10_pages/new admin/top_10_pages#new
edit_admin_top_10_page GET /admin/top_10_pages/:id/edit admin/top_10_pages#edit
admin_top_10_page GET /admin/top_10_pages/:id admin/top_10_pages#show
PUT /admin/top_10_pages/:id admin/top_10_pages#update
DELETE /admin/top_10_pages/:id admin/top_10_pages#destroy
URL調用從開發日誌
ActionController::RoutingError (uninitialized constant Admin::Top10PagesController):
非常感謝。建議更改文件名,也是視圖文件夾名稱,並且所有的工作都很棒。有趣的是,'rails g controller Top10Pages'生成了文件top_10_pages_controller! - 再次感謝您的幫助 :-) – Bob