为什么我的引擎无法加载?
当我启动服务器控制台时显示消息:
`load_missing_constant': Expected D:/alexandre/dev/rails/project_name/lib/admin/engine.rb to define Admin::Engine (LoadError)
但“/lib/admin/engine.rb”存在,其内容为:
Admin::Engine.routes.draw do
get '/' => "admin#index"
get '/error' => "admin#error"
post '/thunder' => "thunder#create", :as => "thunders"
get '/:class' => "admin_models#index"
get '/:class/new' => "admin_models#new"
post '/:class' => "admin_models#create"
get '/:class/:id' => "admin_models#show"
get '/:class/:id/edit' => "admin_models#edit"
put '/:class/:id' => "admin_models#update"
delete '/:class/:id' => "admin_models#destroy"
end
在路线中,我添加了这一行:
mount Admin::Engine => '/admin', :as => 'admin'
项目规格:
- 红宝石 1.9.2p180
- 导轨 3.2.6