2016-06-23 8 views
0

私はこの仕事をしようとしてきたと私は解決策を見つけるように見えることはできません。応答詳細

私はテーブルを持っていると私はDataTableの基本的な初期設定を持っていますすべてうまくいくようですが、応答がアクティブになると、詳細ボタンがクリックされても表示されませんが、 - 記号で赤色になりますが、詳細は表示されません。

この

は私のテーブルです:あなたは <table>とをラップしてみてください、ブートストラップを使用する場合これは私のJS

$('#tabla').DataTable({ 
    responsive: true 
}); 

答えて

0

ある

<table id="tabla" class="display dt-responsive no-wrap" width="100%"> 
    <thead> 
    <tr> 
     <th>Profesor</th> 
     <th>Materia</th> 
     <th>Seccion</th> 
     <th></th> 
     <th></th> 
     <th></th> 
     <th></th> 
    </tr> 
    </thead> 
    <tbody> 
    <% @profesors.each do |profesor| %> 
     <tr> 
     <td><%= profesor.profesor %></td> 
     <td><%= profesor.materia %></td> 
     <td><%= profesor.seccion %></td> 
     <td><%= link_to 'Show', profesor %></td> 
     <td><%= link_to 'Edit', edit_profesor_path(profesor) %></td> 
     <td><%= link_to 'Destroy', profesor, method: :delete, data: { confirm: 'Are you sure?' } %></td> 
     <td><%= link_to 'Alumnos', alumnos_path("prof" => profesor) %></td> 
     </tr> 
    <% end %> 
    </tbody> 
</table> 

<div class="table-responsive">link

いくつかのように:

<div class="table-responsive"> 
    <table id="tabla" class="display dt-responsive no-wrap" width="100%"> 
    <thead> 
     <tr> 
     <th>Profesor</th> 
     <th>Materia</th> 
     <th>Seccion</th> 
     <th></th> 
     <th></th> 
     <th></th> 
     <th></th> 
     </tr> 
    </thead> 
    <tbody> 
     <% @profesors.each do |profesor| %> 
     <tr> 
      <td><%= profesor.profesor %></td> 
      <td><%= profesor.materia %></td> 
      <td><%= profesor.seccion %></td> 
      <td><%= link_to 'Show', profesor %></td> 
      <td><%= link_to 'Edit', edit_profesor_path(profesor) %></td> 
      <td><%= link_to 'Destroy', profesor, method: :delete, data: { confirm: 'Are you sure?' } %></td> 
      <td><%= link_to 'Alumnos', alumnos_path("prof" => profesor) %></td> 
     </tr> 
     <% end %> 
    </tbody> 
    </table> 
</div>