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 9240165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:08:33+00:00 2026-06-18T08:08:33+00:00

This is real noob question, but after searching hard for an answer, perhaps not

  • 0

This is real noob question, but after searching hard for an answer, perhaps not so noob after all: Where exactly do I put the jQuery app DataTables, so that the server side processing starts working? Cannot find the answer over at datatables.net nor here under the datatables tag. (This is using Rails 3.2.2, ruby 1.9.3p362, and datatables 1.9; all required gems appear present )

My jquery source is in public/jquery.js and in public/jquery.dataTables.js

Here’s what I have in my app/assets/javascripts/application.js:

//= require jquery
//= require_tree .

Here’s what I have in app/assets/javascripts/genotypes.js:

$(document).ready(function() {
    $('#genotypes').dataTable( {
        "bProcessing": true,
        "bServerSide": true,
         sAjaxSource: $('#genotypes').data('source')
    } );
} );

Here’s index.html.erb for the relevant view:

<h1>Listing genotypes</h1>

<table id="genotypes" class="display" data-source="<%= genotypes_url(format: "json") %>">
  <thead>
    <tr>
      <th>Marker</th>
      <th>LabID</th>
      <th>SubjectID</th>
      <th>Box</th>
      <th>Well</th>
      <th>Allele1</th>
      <th>Allele2</th>
      <th>Run date</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
  </tbody>
</table>

<br />

<%= link_to 'New Genotype', new_genotype_path %>

So far, all that happens when I load the view for genotypes (http://localhost:3000/genotypes), I just get the column headers, and nothing else…

Any help much appreciated….

  • 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-06-18T08:08:34+00:00Added an answer on June 18, 2026 at 8:08 am

    Your javascript files should live in app/assets/javascripts/, not in the public folder.
    Take a look at this : http://guides.rubyonrails.org/asset_pipeline.html.

    Try to move jquery.js into this directory and then, like Ryan says in the Railscasts you mentioned, add this line in your application.js :

    //= require dataTables/jquery.dataTables.

    Do the same with your css files and give it a try.

    Hope this helps.

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

Sidebar

Related Questions

Real noob question no doubt, but I can't get my head around this behaviour.
This surely is a noob question, but I can't find an answer in Doxygen
This is not a real bug BUT for sure it is not what you
So this should be a real easy question but I can't seem to find
If this is not a real question then feel free to close ;)
This is going to be a real noob question, so please have mercy. I
This is a broad question in search of a decent broad answer, but I
This is a very general and noob question, but I am a noob with
This is a real noob question. When I set up JAVA_HOME using the command
I feel like a real noob asking this, but here's my problem: I want

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.