tap/app/views/products/update.js.erb
2015-04-03 23:56:13 +02:00

6 lines
285 B
Text

<% if @product.errors.any? %>
$('#products-errors').html("<%= j render 'errors', object: @product %>")
<% else %>
$('#products-errors').html('')
$("#products_row_<%= dom_id(@product) %>").replaceWith("<%= j render 'products_list/product_row', product: @product %>");
<% end %>