$("#cash_register_errors").html("");
<% if @cash_register.errors.any? %>
  $('#cash_register_errors').removeClass('hidden');
  <% @cash_register.errors.values.each do |message| %>
    $("#cash_register_errors").append($("<li />").html("<%= message.first.to_s %>"));
  <% end %>
<% else %>
  $('#dialog').modal('toggle');
  window.location = "<%= cash_registers_path %>";
  $("#notice").html("<%= flash[:notice] %>");
<% end %>
