Executes the response body as JavaScript in the context of the parent window.
Use this method of you are posting a form to a hidden IFRAME or if you would like to use IFRAME base RPC.
Methods
Public Instance methods
Redirect parent to a new url
[ show source ]
# File lib/controller/responds_to_parent.rb, line 20
20: def redirect_parent_to(location)
21: responds_to_parent do
22: render :update do |page|
23: page.load location
24: end
25: end
26: end
Render an action to parent
[ show source ]
# File lib/controller/responds_to_parent.rb, line 9
9: def render_to_parent(*options_for_render)
10: responds_to_parent do
11: # I don't use page.update for prevent dobule rendering
12: # and so we can save rendering time!
13: source = render_to_string(*options_for_render)
14: render :update do |page|
15: page.call "Backend.app.update", source
16: end
17: end
18: end