title: Ajax Paging working in development but not in production (heroku) - Rails 3.1
body: <p>Somehow ajax paging is working in my Rails 3.1 development environment but not when i deploy it to heroku. The paging id working but without ajax.</p>
  
  <p>I know that's a lot of code. But i prefer not to miss out files which might be important.</p>
  
  <p>Could it have something to do with the assets pipeline?</p>
  
  <p><strong>EDIT:</strong> Fixed it. Somehow heroku had problems precompiling my assets.</p>
  
  <p>Customer controller:</p>
  
  <pre><code>def index
    @title = "Customers"
    company = current_company
    @customers = company.customers.search(params[:search]).paginate(:page =&gt; params[:page], :order =&gt; 'lastname ASC')
  
    respond_to do |format| 
      format.html # index.html.erb 
      format.js # index.js.erb 
    end
  end
  </code></pre>
  
  <p>The index view file:</p>
  
  <pre><code>&lt;div id="customers"&gt;&lt;%= render 'customers'%&gt;&lt;/div&gt;
  
  &lt;% content_for :actionButtons do %&gt;
  &lt;div class="pageHeader"&gt;
  &lt;div class="row"&gt;
  
  &lt;div class="span6"&gt;
  &lt;div class="action_links"&gt;
      &lt;%= link_to t('buttons.newCustomer'), new_customer_path, :class =&gt; "btn primary" %&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="span8"&gt;
  &lt;%= form_tag customers_path, :method =&gt; "get", :id =&gt; "customers_search" do %&gt;
  &lt;fieldset&gt;
  &lt;div class="clearfix"&gt;
      &lt;div class="input"&gt;
          &lt;%= text_field_tag(:search, params[:search], :placeholder=&gt;"Search", :class =&gt; "inputText") %&gt;
          &lt;%= submit_tag t('buttons.search'), :name =&gt; nil, :class=&gt;"btn primary" %&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/fieldset&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>_customers.html.erb:</p>
  
  <pre><code>&lt;% if @customers.count == 0 %&gt;
  
  &lt;h2&gt;No customers found...&lt;/h2&gt;
  
  &lt;% else %&gt;
  
  &lt;div class="row"&gt;
  &lt;div class="span10"&gt;
  &lt;%= hidden_field_tag :direction, params[:direction] %&gt;
  &lt;%= hidden_field_tag :sort, params[:sort] %&gt;
  &lt;%= will_paginate(@customers, :renderer =&gt; HosperoListLinkRenderer)%&gt;   &amp;nbsp;
  &lt;/div&gt;
  &lt;div class="span5"&gt; 
  &lt;div class="pagingInfos"&gt;
      &lt;%= page_entries_info @customers %&gt; 
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;table class="bordered-table zebra-striped"&gt;
  &lt;tr&gt;    
    &lt;th&gt;Name&lt;/th&gt;
  &lt;th&gt;Phone&lt;/th&gt;
    &lt;th&gt;&lt;/th&gt;
  &lt;th&gt;&lt;/th&gt;
  &lt;th&gt;&lt;/th&gt;
  &lt;/tr&gt;
  
  &lt;% @customers.each do |customer| %&gt;
  &lt;tr&gt;     
    &lt;td&gt;&lt;%= customer.lastname %&gt; &lt;%= customer.firstname %&gt;&lt;/td&gt;
  &lt;td&gt;&lt;%= customer.phonenumber %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to t('buttons.show'), customer, :class =&gt; "button" %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to t('buttons.edit'), edit_customer_path(customer), :class =&gt; "button edit"  %&gt;&lt;/td&gt;
    &lt;td&gt;&lt;%= link_to t('buttons.delete'), customer, confirm: 'Are you sure?', method: :delete, :class =&gt; "button delete"  %&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;% end %&gt;
  &lt;/table&gt;
  &lt;%= will_paginate(@customers, :renderer =&gt; HosperoListLinkRenderer)%&gt; 
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>index.js.erb:</p>
  
  <pre><code>$('#customers').html('&lt;%= escape_javascript(render :partial =&gt; "customers") %&gt;');
  </code></pre>
  
  <p>app/assets/javascripts/customers.js:</p>
  
  <pre><code>$(function() {
    $("#customers th a, #customers .pagination a").live("click", function() {
      $.getScript(this.href);
      return false;
    });
    $("#customers_search input").keyup(function() {
      $.get($("#customers_search").attr("action"), $("#customers_search").serialize(), null, "script");
      return false;
    });
  });
  </code></pre>