2013-12-07 11:20:03 +01:00
|
|
|
// Handle more advanced DOM update after AJAX database manipulation.
|
|
|
|
// See publish/subscribe design pattern in /doc.
|
|
|
|
(function() {
|
2013-12-07 17:10:40 +01:00
|
|
|
$('#articles-tbody tr').removeClass('success');
|
|
|
|
|
2013-12-07 11:20:03 +01:00
|
|
|
var stock_article_row = $('<%= j(render(
|
|
|
|
:partial => 'stock_article',
|
|
|
|
:locals => {
|
|
|
|
:stock_article => @stock_article
|
|
|
|
}
|
2013-12-07 17:10:40 +01:00
|
|
|
)) %>').addClass('success');
|
2013-12-07 11:20:03 +01:00
|
|
|
|
|
|
|
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
|
|
|
|
})();
|