- 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}");