ducati1212 ducati1212 - 1 year ago 94
Javascript Question

Rails 4 datatable ajax routing issue

Im trying to use the sample code from -- > https://datatables.net/examples/api/row_details.html

I am just playing around with the sample in my existing project as a demo. All my DataTable methods are in a tests.js class in assets/javascript

My controller is not doing anything right now until I hook this up to mongo for real but right now I want to use that objects.txt son file to play around with the table to get it correct. Im not sure what route I need since that document.ready method is in tests.js

$(document).ready(function() {
var table = $('#queryone_table').DataTable( {
"ajax": "/rails/public/objects.txt",
"columns": [

Routing Error

Started GET "/rails/public/objects.txt?_=1479232156328" for ::1 at 2016-11-15 12:49:17 -0500

ActionController::RoutingError (No route matches [GET] "/rails/public/objects.txt"):

Answer Source

I was using the full path /rails/public/objects.txt" all I needed to do was /objects.txt

my bad

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download