0
나는이 (가) application.js에서 다음을 가지고 있고 나는 또한 jQuery를 prices.coffee.js하나의
에퍼팅 시도했습니다 - >
$('#container').dataTable();
그러나, 다음 표는 DataTable의 디자인에 포맷되지 않습니다
<h2>Energy Prices</h2>
<p id="notice"><%= notice %></p>
<table id ="container" class="display">
<thead>
<tr>
<th>ID</th>
<th>Month</th>
<th>Elec</th>
<th>Gas</th>
<th>Biomass</th>
</tr>
</thead>
<tbody>
<% @usages.each do |usage| %>
<tr>
<td><%= usage.price.usage_id %></td>
<td><%= usage.month.strftime("%b %Y") %></td>
<% usage.price.attributes.each do |k,v| %>
<% if v.nil? %>
<td>N/A</td>
<% elsif k != "created_at" && k != "updated_at" && k != "month" && k != "id" && k != "usage_id" %>
<td><%= v %></td>
<% end %>
<% end %>
<td><%= link_to "Edit", edit_price_path(usage) %> </td>
</tr>
<% end %>
</tbody>
</table>
하이 제임스 감사합니다. 두 테이블이 이제
관련 문제