【发布时间】:2016-07-19 14:34:42
【问题描述】:
我是 Ruby on Rails 的初学者。 而且我是韩国人。所以我的话有点奇怪... 我的问题是这个... 如果我有 10 个数据,我想将第 1~5 个数据放在第一行,将第 6~10 个数据放在第二行。
我试过这个代码
<table border height=300 width=300 align=center>
<thead>
<tr style="font size:20;">
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% if current_user.samulham.nil? %>
<tr>
<% @samulham.each do |x| %>
<% if x.user_id.present?%>
<td><%= "X" %></td>
<% else %>
<td><%= link_to "#{x.lockernumber}", {:controller => "home", :action => "register", :cur_user => current_user.id, :cur_samulham => x.id}, method: :post %></td>
<% end %>
<% end %>
</tr>
<% end %>
</tbody>
</table>
感谢您的考虑。 :)
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 ruby-on-rails-3.2