$('div.container-fluid').prepend( '<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @order_article.article.name)})) %>' ); (function() { $('.ordered-articles tr').removeClass('success'); var article_for_adding = $( '<%= j(render(:partial => 'edit_article', :locals => {:order_article => @order_article})) %>' ).addClass('success'); $('.ordered-articles tbody').append(article_for_adding); updateSort('.ordered-articles'); })();