开发者

In rails 3, how do I use page.call to call a function and pass it multiple parameters?

开发者 https://www.devze.com 2023-03-01 07:22 出处:网络
I\'m using page.call to call a function in my rails application that is using jquery-ujs. Right now 开发者_开发问答I have it working fine with one parameter being passed:

I'm using page.call to call a function in my rails application that is using jquery-ujs. Right now 开发者_开发问答I have it working fine with one parameter being passed:

page.call "functionName", "div_name"

to call

functionName(div_name)
{
}

but I'd like to pass two parameters to this function:

functionName(div_name, other_variable)
{
}

How can I do this using page.call?

Thanks so much.


Have you tried simply adding another argument to the call? It looks like page.call() uses varargs for the arguments.

You should simply be able to do

page.call 'functionName', 'arg1', 'arg2'
0

精彩评论

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