开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜