$('#list_items_in_cart').replaceWith('<%= escape_javascript(render :partial => 'reservations/list_items_in_cart') %>');
<% # availability updates %>
<% if @item %>
  var add_to_cart_btn = $('<%= "#add_to_cart_#{@item.id}" %>').children('.btn')
  $('<%= "#availability_#{@item.id}" %>').html(<%= @availability_hash[@item.id] %>);
  <% if @availability_hash[@item.id] <= 0 %>
    add_to_cart_btn.replaceWith('<%= button_tag "Add to Cart", :class => "btn disabled add_to_cart_disabled"%>')
  <% else %>
    add_to_cart_btn.replaceWith('<%= link_to "Add to Cart", add_to_cart_path(@item), :method => :put, :remote => true, :class => "btn add_to_cart" %>');
  <% end %>
<% end %>
resume_cart();

<% if (flash[:error].blank? && flash[:notice].blank? && flash[:alert].blank?) %>
  $('#flashes').html('');
<% else %>
  $('#flashes').html('<%= escape_javascript(render :partial => 'layouts/flash_alerts') %>');
  <% flash.clear %>
<% end %>

$('#list_items_in_cart').replaceWith('<%= escape_javascript(render :partial => 'reservations/list_items_in_cart') %>');
<% # availability updates %>
<% if @item %>
  var add_to_cart_btn = $('<%= "#add_to_cart_#{@item.id}" %>').children('.btn')
  $('<%= "#availability_#{@item.id}" %>').html(<%= @availability_hash[@item.id] %>);
  <% if @availability_hash[@item.id] <= 0 %>
    add_to_cart_btn.replaceWith('<%= button_tag "Add to Cart", :class => "btn btn-default disabled add_to_cart_disabled"%>')
  <% else %>
    add_to_cart_btn.replaceWith('<%= link_to "Add to Cart", add_to_cart_path(@item), :method => :put, :remote => true, :class => "btn btn-default add_to_cart" %>');
  <% end %>
<% end %>
resume_cart();

<% if (flash[:error].blank? && flash[:notice].blank? && flash[:alert].blank?) %>
  $('#flashes').html('');
<% else %>
  $('#flashes').html('<%= escape_javascript(render :partial => 'layouts/flash_alerts') %>');
  <% flash.clear %>
<% end %>

Fix add to cart btn forgetting it's a btn issue
Fix add to cart btn forgetting it's a btn issue
