RJS across iframes

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.

| |

Update with RJS
| |
| ±--------------------------------+ |
| |

If anybody has a clean way to do this, would be interested. But
otherwise have solved it by coding native javascript :frowning:

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_’ + photo.id);},
parameters: “id=” + photo_id});


works perfectly.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs