From ead021b7895c1827ab293de58731476dcdb8742d Mon Sep 17 00:00:00 2001 From: Carsten Otto Date: Tue, 14 Apr 2015 23:50:50 +0200 Subject: [PATCH] replace element instead nesting another div inside existing div --- app/views/todos/_update_successful.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/todos/_update_successful.js.erb b/app/views/todos/_update_successful.js.erb index 40315920..730b1d58 100644 --- a/app/views/todos/_update_successful.js.erb +++ b/app/views/todos/_update_successful.js.erb @@ -55,7 +55,7 @@ add_to_existing_container: function(next_steps) { <% end -%> }, replace_todo: function(next_steps) { - $('#<%= dom_id(@todo) %>').html(<%=object_name%>.html_for_todo()); + $('#<%= dom_id(@todo) %>').replaceWith(<%=object_name%>.html_for_todo()); next_steps.go(); }, hide_container: function(next_steps) {