$('div[rel=<%= resource.id %>]').replaceWith('<%= escape_javascript(render(partial: "object", object: resource)) %>');