RoR:Javascript 调用 +控制器中的页面更新
我正在尝试在 Rails 控制器中实现以下功能:
"jQuery(document).ajaxStop(jQuery.unblockUI);"
# "unblocks" a blocked DIV
在控制器中,到目前为止我已经...
render :update do |page|
page.replace_html 'my_div', :partial => 'my_partial'
[...]
page.call 'jQuery.unblockUI()' # this is the line...
end
...但这不起作用。怎么了?解决这个问题的办法是什么?
非常感谢您的任何提示和帮助!
汤姆
===
编辑:“render :update do |page| ...”和“page.call ...”之间是否可能存在冲突?
编辑2:“不起作用”,我的意思是:控制器正常执行,DIV“my_div”正常替换,但“阻止”DIV不会“解除阻止”。 Firebug 并没有在控制台中指示任何错误......
I'm trying to implement the following function in a Rails controller:
"jQuery(document).ajaxStop(jQuery.unblockUI);"
# "unblocks" a blocked DIV
In the controller, I have so far...
render :update do |page|
page.replace_html 'my_div', :partial => 'my_partial'
[...]
page.call 'jQuery.unblockUI()' # this is the line...
end
...but this does not work. What's wrong? And what's the solution to this?
Thanks a lot for any hints and help with this!
Tom
===
Edit: Is there maybe a conflict between "render :update do |page| ..." and "page.call ..." ?
Edit 2: By "does not work", I mean: the controller gets executed normally, the DIV "my_div" gets replaced normally, but the "blocked" DIV does not get "unblocked". And Firebug does not indicate any error in the console...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在控制器中调用的函数正在调用 prototype 函数。您需要安装 jRails 才能使用 jQuery。
The function you are calling in the controller are calling prototype functions. You need to install jRails to make it work with jQuery.