2
Rails 3.2.2
내가 페이지 /my_controller/some_action1
의 RoR
#routes
namespace :my_controller do
get 'some_action1'
get 'some_action2/:some_param1'
end
#Controller
class MyController < ApplicationController
def some_action1
end
def some_action2
#handling the ajax request
respond_to do |format|
format.js
end
end
end
#View /my_controller/some_action1.html.haml
link_to "my_link", {:controller => :my_controller, :action => :some_action2,
:some_param1=>123}, :remote=>true, :id=>"unique_id123"
의견에 갈 경우에도이 코드는 예외 ArgumentError missing :action
를 throw에 행동권 매개 변수를 전달 할 수 없습니다?
사용해서는 안 어떻게 그 [네임 스페이스] (http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing) . Erez의 답변이가는 길 같습니다. – Mischa