% if current_subject.suggestion.present? %> <% content_for :javascript do %> $(".suggestions .tie_close").livequery("click",function(){ temp = $(this); $.get("<%=suggestion_ties_path%>", function(data) { temp.parents(".tie").replaceWith(data); }); }); <% end %>