在我使用搜索之前,Rails数据表不起作用

时间:2015-12-05 04:43:37

标签: jquery ruby-on-rails datatable

您好我尝试使用DataTable gem我安装了数据表和jquery ui:

#define BUF_SIZE 70000
char *buf = (char*)malloc(BUF_SIZE);
int written = 0;
int wrote;
if (buf)
   memset(buf, 1, BUF_SIZE);
else
   return written;//some error code

while (written < BUF_SIZE)
{
  wrote = write(fd, buf, BUF_SIZE);
  if (wrote < 0)
    return written;
  written += wrote;
}

并将它们添加到我的应用清单中: application.js.coffee:

gem 'jquery-datatables-rails', '~> 3.3.0'
gem 'jquery-ui-rails'

application.scss:

#= require jquery
#= require jquery_ujs
#= require turbolinks
#= require bootstrap-sprockets
#= require jquery-ui
#= require dataTables/jquery.dataTables
#= require_tree .

我的payment.coffee

 *= require_self
 *= require font-awesome
 *= require jquery-ui
 *= require dataTables/jquery.dataTables
 *= require_tree .
 */

实际表格:

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

jQuery ->
  $('#student_payments').dataTable()

奇怪的是,它直到我搜索任何东西都没有工作,我不能对列进行排序,分页没有处理,但是当我搜索任何东西时,数据表就会变得生动:D,桌子正在变形paginate,我可以对列进行排序。

知道为什么吗?

1 个答案:

答案 0 :(得分:0)

问题在于资产,我改变了它们,现在它工作正常:)

application.js.coffee:

#= require jquery
#= require jquery_ujs
#= require turbolinks
#= require bootstrap-sprockets
#= require dataTables/jquery.dataTables
#= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
#= require_tree .

application.scss:

 *= require_self
 *= require font-awesome
 *= require jquery-ui
 *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
 *= require_tree .