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