<% if @product.blank? %> toastr["error"]("Error, Producto no encontrado."); <%elsif @existence == true %> toastr["error"]("Error, El cliente ya tiene asignado el producto seleccionado."); <% else %> var table = $('#products_table').DataTable(); var newRow = '<%= j render (@special_price) %>'; table.row.add($(newRow)).draw(); <% end %>