2010-04-16 58 views
0

我有以下控制器问题未初始化的不断

class ActiveUsersController < ApplicationController 

def edit 
end 

而我的routes.rb是这样的:

map.resources :active_users 

当我尝试使用URL访问控制器http://localhost:3000/active_users/COo8e45RqQAHr6CqSCoI/edit我得到以下错误:

NameError in Active usersController#edit 

uninitialized constant ActiveUsersController 
RAILS_ROOT: /Users/vintem/Documents/Projetos/Pessoal/bugfreela 

Application Trace | Framework Trace | Full Trace 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in `constantize' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in `constantize' 
/Users/vintem/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' 
/Users/vintem/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in `recognize' 
/Users/vintem/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in `call' 

任何人都可以帮助我吗?

由于

回答

0

resources模型和类似命名的一个相关成分的假定控制器。你有ActiveUser模型类吗?或者是其他的东西,比如User?例如: -

map.resources users, :controller => "active_users" 

退房的API文档: http://api.rubyonrails.org/classes/ActionController/Resources.html

很难说什么是从您所提供的信息是错误的。

+0

我添加了一个ActiveUser模型类,但它没有改变任何东西 – vintem 2010-04-16 21:20:22