Ruby on rails 有没有办法修复rails 3.1中的单一控制器?

Ruby on rails 有没有办法修复rails 3.1中的单一控制器?,ruby-on-rails,ruby-on-rails-3.1,Ruby On Rails,Ruby On Rails 3.1,我意外地生成了一个没有“s”的单一控制器通信日志已将s添加到控制器名称、辅助对象、视图、规格和管线中。客户通信日志路径(f.customer\u id,f.id)似乎不正确 关系是一个通信日志属于一个客户,而一个客户有多个通信日志 resources :customers do resources :comm_logs end rake路由(相关)的输出为: 有没有办法修复奇异控制器?谢谢。尝试使用创建控制器时使用的相同控制器名称编写脚本/销毁您的控制器名称。除了销毁生成的控制

我意外地生成了一个没有“s”的单一控制器通信日志已将s添加到控制器名称、辅助对象、视图、规格和管线中。客户通信日志路径(f.customer\u id,f.id)似乎不正确

关系是一个通信日志属于一个客户,而一个客户有多个通信日志

  resources :customers do
    resources :comm_logs
  end
rake路由(相关)的输出为:


有没有办法修复奇异控制器?谢谢。

尝试使用创建控制器时使用的相同控制器名称编写脚本/销毁您的控制器名称。

除了销毁生成的控制器名称外,还有什么方法修复它吗?或者修复不是一个好主意。销毁/重做可能是处理此问题的简单方法。我同意user938363,最好先销毁,然后再执行。和往常一样,在销毁前保存一份副本。这样做(destrot)也是一个好主意,因为它删除了测试存根等,否则,这些存根通常会“到处乱放”
         comm_logs_index GET    /comm_logs/index(.:format)                                      {:controller=>"comm_logs", :action=>"index"}
           comm_logs_new GET    /comm_logs/new(.:format)                                        {:controller=>"comm_logs", :action=>"new"}
        comm_logs_create GET    /comm_logs/create(.:format)                                     {:controller=>"comm_logs", :action=>"create"}
          comm_logs_show GET    /comm_logs/show(.:format)                                       {:controller=>"comm_logs", :action=>"show"}
       comm_logs_destroy GET    /comm_logs/destroy(.:format)                                    {:controller=>"comm_logs", :action=>"destroy"}

      customer_comm_logs GET    /customers/:customer_id/comm_logs(.:format)                     {:action=>"index", :controller=>"comm_logs"}
                         POST   /customers/:customer_id/comm_logs(.:format)                     {:action=>"create", :controller=>"comm_logs"}
   new_customer_comm_log GET    /customers/:customer_id/comm_logs/new(.:format)                 {:action=>"new", :controller=>"comm_logs"}
  edit_customer_comm_log GET    /customers/:customer_id/comm_logs/:id/edit(.:format)            {:action=>"edit", :controller=>"comm_logs"}
       customer_comm_log GET    /customers/:customer_id/comm_logs/:id(.:format)                 {:action=>"show", :controller=>"comm_logs"}
                         PUT    /customers/:customer_id/comm_logs/:id(.:format)                 {:action=>"update", :controller=>"comm_logs"}
                         DELETE /customers/:customer_id/comm_logs/:id(.:format)                 {:action=>"destroy", :controller=>"comm_logs"}