我遇到了以下问题:我创建了一个新的控制器操作,因为它永远不会有效! 这是我在控制器中的动作:
class IngressTransportDocumentsController < ApplicationController
.......
def troa
@address = Registry.find(:all, :conditions => ["destination_address = ?",params[:destination_address]]).map{|stp| [stp.name,stp.id]}.sort
respond_to do |format|
format.js {render :partial => 'get_address'}
end
end
这是我的routes.rb
resources :ingress_transport_documents do
resources :bulk_warehouse, :only =>[:udpate_csv, :index] do
collection do
get :update_csv
post :bulk_operations
end
end
collection do
post :troa
end
end
当我尝试向http://localhost:3000/ingress_transport_documents/troa应用程序发出POST请求时,请回复我,并显示以下错误消息:
Unknown action
The action 'troa' could not be found for IngressTransportDocumentsController
错误在哪里? 提前谢谢大家