Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6980725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:03:49+00:00 2026-05-27T18:03:49+00:00

Somehow ajax paging is working in my Rails 3.1 development environment but not when

  • 0

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.

I know that’s a lot of code. But i prefer not to miss out files which might be important.

Could it have something to do with the assets pipeline?

EDIT: Fixed it. Somehow heroku had problems precompiling my assets.

Customer controller:

def index
  @title = "Customers"
  company = current_company
  @customers = company.customers.search(params[:search]).paginate(:page => params[:page], :order => 'lastname ASC')

  respond_to do |format| 
    format.html # index.html.erb 
    format.js # index.js.erb 
  end
end

The index view file:

<div id="customers"><%= render 'customers'%></div>

<% content_for :actionButtons do %>
<div class="pageHeader">
<div class="row">

<div class="span6">
<div class="action_links">
    <%= link_to t('buttons.newCustomer'), new_customer_path, :class => "btn primary" %>
</div>
</div>
<div class="span8">
<%= form_tag customers_path, :method => "get", :id => "customers_search" do %>
<fieldset>
<div class="clearfix">
    <div class="input">
        <%= text_field_tag(:search, params[:search], :placeholder=>"Search", :class => "inputText") %>
        <%= submit_tag t('buttons.search'), :name => nil, :class=>"btn primary" %>
    </div>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
<% end %>

_customers.html.erb:

<% if @customers.count == 0 %>

<h2>No customers found...</h2>

<% else %>

<div class="row">
<div class="span10">
<%= hidden_field_tag :direction, params[:direction] %>
<%= hidden_field_tag :sort, params[:sort] %>
<%= will_paginate(@customers, :renderer => HosperoListLinkRenderer)%>   &nbsp;
</div>
<div class="span5"> 
<div class="pagingInfos">
    <%= page_entries_info @customers %> 
</div>
</div>
</div>
<table class="bordered-table zebra-striped">
<tr>    
  <th>Name</th>
<th>Phone</th>
  <th></th>
<th></th>
<th></th>
</tr>

<% @customers.each do |customer| %>
<tr>     
  <td><%= customer.lastname %> <%= customer.firstname %></td>
<td><%= customer.phonenumber %></td>
  <td><%= link_to t('buttons.show'), customer, :class => "button" %></td>
  <td><%= link_to t('buttons.edit'), edit_customer_path(customer), :class => "button edit"  %></td>
  <td><%= link_to t('buttons.delete'), customer, confirm: 'Are you sure?', method: :delete, :class => "button delete"  %></td>
</tr>
<% end %>
</table>
<%= will_paginate(@customers, :renderer => HosperoListLinkRenderer)%> 

<% end %>

index.js.erb:

$('#customers').html('<%= escape_javascript(render :partial => "customers") %>');

app/assets/javascripts/customers.js:

$(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;
  });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:03:49+00:00Added an answer on May 27, 2026 at 6:03 pm

    As your code looks OK, I would guess that your assets aren’t loading for some reason. Either they haven’t compiled and thus aren’t being served, or your not loading them correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've been trying to login through AJAX but somehow its not working. my controller
I have a lot of ajax calls that ask a page to insert partials
I'm not sure if someone on here will know a reason for this, but
Somehow Visual Studio search has stopped working for me. Anytime I search Entire Solution
Somehow I had the impression that ASP.Net differentiates URLs based on the number of
somehow couldn't find this with a google search, but I feel like it has
I am working on a codeigniter site, the client has requested that the price
I'm trying to get value to two hidden fields in AJAX which somehow is
I use in my Ajax.Request my jsp. (Prototype) Somehow I can pass extra parameters
I have this problem, I load a page using JQuery ajax, now within that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.