2
我在Redmine中執行代碼遷移,實際版本不接受remote_function
調用。如何將remote_function替換爲某個jquery調用
所以我讀到,有一種方法可以做到remote_function
在使用jquery
之前做的同樣的事情。問題是我不知道如何去做。有人可以幫助我嗎?
婁我的代碼:
view.rb
<%= button_to_function l(:gerar_build_project), remote_function(:action => 'exec_client', :controller => 'repositories') %>
repositories_controller.rb
def exec_client
...
end
的routes.rb
match 'projects/:id/repository', :action => 'exec_client', :controller => 'repositories', :via => :post
match 'projects/:id/repository/:branch', :action => 'exec_client', :controller => 'repositories', :via => :post
你的意思是你想寫一個手工或其他的AJAX查詢?這基本上是'remote:true'和UJS驅動程序所做的。 https://github.com/rails/jquery-ujs/blob/master/src/rails.js –