我的 rjs 模板中有以下代码,它显示一个确认框:
page << "r = confirm('Would you like to link this newly created author to the book?')"
我试过了
`page << "if r == true {"`
#do action a
`page << "} else {"`
#do action b
`page << "}"`
上面的代码不正确。
我的问题是如何获得在确认框中所做的选择(真或假)的值?
提前谢谢了。