2011-12-29 4 views
0

실수로 's'가없는 단일 컨트롤러 comm_log가 생성되었습니다. 컨트롤러 이름, 도우미,보기, 사양 및 경로에 's'가 추가되었습니다. customer_comm_log_path (f.customer_id, f.id)가 올바르지 않은 것 같습니다.레일 3.1에 단수 컨트롤러를 수정하는 방법이 있습니까?

관계는 고객에게 속한 통신 로그이며 고객에게는 많은 통신 로그가 있습니다.

resources :customers do 
    resources :comm_logs 
    end 

(관련) 퀴 경로의 출력은 : 단일 제어기를 해결하는 방법

  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"} 

있는가? 감사.

답변

1

script/destroy your_controller_name을 만들 때 사용한 것과 동일한 컨트롤러 이름을 사용해보십시오.

+0

생성 된 파일을 파괴하는 것 외에도이를 수정하는 방법이 있습니까? 또는 고치는 것이 좋습니다. – user938363

+0

파괴/재실행은 아마도 이것을 처리하기위한 쉬운 방법 일 것입니다. – user938363

+0

나는 user938363에 동의합니다. 파괴하고 다시하는 것이 가장 좋습니다. 항상 그렇듯이 파괴하기 전에 복사본을 저장하십시오. 이것을 (destrot)하는 것은 테스트 스텁 등을 제거 할 때 좋은 생각이기도합니다. 그렇지 않으면, 종종 '주변에 놓여 있습니다' –

관련 문제