谁能告诉我为什么我的 rails 应用程序在我执行 select 语句时会返回这段代码?
#<Driver:0x22ef3f0>
选择语句是:
current_schedule_record = {
'driver_name' => Driver.where(['id = ?', id]).select('first_name').first
}
观点是:
<% @trucks.each do |truck| %>
<% record = ScheduleController.schedule_record(truck.id) %>
<tr>
<td><%= truck.id %></td>
<td><%= record['driver_name'] %></td>
</tr>
<% end %>