Forum: Ruby on Rails RJS across iframes

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
James M. (Guest)
on 2006-04-09 15:59
I have an inline iframe which has a form in it, when the form is
updated, I would like to call an RJS template that will update the
parent page.

|                                               |
| <div id="mydiv"> Update with RJS </div>       |
|                                               |
|  +---------------------------------+          |
|  | <iframe> with form that when    |          |
|  | update will call RJS teplate to |          |
|  | update "mydiv"                  |          |
|  +---------------------------------+          |

If in the controller I can pass the RJS template the parent page rather
than the iframe's page which will be the default for any action that
renders the iframe...

Anybody got any suggestions...

James M. (Guest)
on 2006-04-10 03:23
If anybody has a clean way to do this, would be interested. But
otherwise have solved it by coding native javascript :(

FYI this was to create an inline image uploader as you can't do this
with ajax so I embedded an iframe and wrapped it with javascript to
emulate ajax.

On the iframe;


and then on the parent form;

function myFunctionOnTheParentWindow(object_it) {

if (photo_id) {
	new Ajax.Updater('photo_items', '/admin/photo_show',
		{asynchronous:true, evalScripts:true,
onComplete:function(request){Element.hide("photo_upload_saving"); new
Effect.Highlight('photo_box_' +;},
			 parameters: "id=" + photo_id});


works perfectly.
This topic is locked and can not be replied to.