开发者

RoR: Javascript call + page update in controller

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 wi开发者_JS百科th 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...


The function you are calling in the controller are calling prototype functions. You need to install jRails to make it work with jQuery.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜