AJAX_ify StockArticle manipulation; Introduce publish/subscribe pattern for DOM updates
This commit is contained in:
parent
e99752e483
commit
dd08e277c7
22 changed files with 313 additions and 107 deletions
15
app/views/stockit/create.js.erb
Normal file
15
app/views/stockit/create.js.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
$('div.container-fluid').prepend('<%= j(render(
|
||||
:partial => 'shared/alert_success',
|
||||
:locals => {
|
||||
:alert_message => t('.notice', :name => @stock_article.name)
|
||||
}
|
||||
)) %>');
|
||||
|
||||
// Publish database changes.
|
||||
// See publish/subscribe design pattern in /doc.
|
||||
$(document).trigger({
|
||||
type: 'StockArticle#create',
|
||||
stock_article_id: <%= @stock_article.id %>
|
||||
});
|
||||
|
||||
$('#modalContainer').modal('hide');
|
||||
Loading…
Add table
Add a link
Reference in a new issue