AJAX_ify StockArticle manipulation; Introduce publish/subscribe pattern for DOM updates

This commit is contained in:
Julius Rapp 2013-12-07 11:20:03 +01:00
parent e99752e483
commit dd08e277c7
22 changed files with 313 additions and 107 deletions

View file

@ -0,0 +1,12 @@
// Handle more advanced DOM update after AJAX database manipulation.
// See publish/subscribe design pattern in /doc.
(function() {
var stock_article_row = $('<%= j(render(
:partial => 'stock_article',
:locals => {
:stock_article => @stock_article
}
)) %>');
$('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
})();