开发者

How to send "multiple" extra parameters on a link/button_to_remote call?

开发者 https://www.devze.com 2022-12-22 13:02 出处:网络
In this example, <%=button_to_remote \"Get Related Users\", {:url => { :action => \'get_related_users\' },

In this example,

<%=button_to_remote "Get Related Users", {:url => { :action => 'get_related_users' }, 
          :update => 'result',:with=>"'someVal=3'"} %>

If I have to send one more key/value pair [someVal2=5], what will the :w开发者_如何转开发ith look like?


The docs say

A JavaScript expression specifying the parameters for the XMLHttpRequest. Any expressions should return a valid URL query string.

so I imagine that you would do something like

<%=button_to_remote "Get Related Users", {:url => { :action => 'get_related_users' }, 
          :update => 'result',:with=>"'someVal=3&someVal2=5'"} %>
0

精彩评论

暂无评论...
验证码 换一张
取 消