Have a separate js file for datatables. Have a Rails module for datatables.