RoR3:嵌套命名空间路由,未定义方法错误

时间:2010-12-15 09:37:07

标签: namespaces ruby-on-rails-3 activescaffold

我正在使用命名空间路由来创建管理部分。

问题是,当我将非命名空间和工作控制器移动到/ admin命名空间时,我突然得到未定义的方法错误。

Showing 

/media/_portable_/appname/vendor/plugins/active_scaffold/frontends/default/views/_form_messages.html.erb where line #4 raised:

undefined method `errors' for :record:Symbol
Extracted source (around line #4):

1: <%= render :partial => 'messages' %>
2: 
3: <% unless @record.nil? %>
4:     <%= error_messages_for :record, :object_name => @record.class.model_name.human.downcase %>
5: <% end %>

routes.rb

 namespace :admin do 
    root :controller => 'dashboard', :action => "index"
    resources :dashboard, :users, :apps do
      as_routes
    end
    resources :admin_sessions, :only => [:new, :create, :destroy]
  end

有关我如何解决此问题的任何帮助?