-2
我想表明从员工考勤表,该表是白天和现在的两列,但无法显示 -如何从ror中的控制器传递参数?
这里是我的节目页面 -
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">Holiday Setup</h3>
</div><!-- /.box-header -->
<div class="box-body">
<table id="example1" class="table table-bordered table-hover table-condensed">
<thead>
<tr>
<th>Day</th>
<th>Present</th>
</tr>
</thead>
<tbody>
<% @employee_attendances.each do |employee_attendance| %>
<tr>
<td><%= employee_attendance.day %></td>
<td><%= employee_attendance.present %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
控制器代码 -
def holiday_setup
@day = params[:day]
@employee_attendances = EmployeeAttendance.where(present: 'H',day: @day)
end
*但无法显示*你会得到有什么错误? – Pavan
没有..但是当我调试一天给零。 –
'params [:day]''里有什么吗? –