我是一个新的ruby开发人员,找不到错误数据库有表,但它没有调用
<% @orders.each do |order| %>
<tr>
<td><%= order.listing.name %></td>
<td><%= order.buyer.name %></td>
<td><%= order.created_at.strftime("%B %-d, %Y") %></td>
</tr>
<% end %>
</table>
而且数据库在订单和清单名称中添加了一个值。
github回购总额为https://github.com/dinesh124/roughmart?files=1 此错误为nomethod error order.listing.name注册后在销售页中找不到名称
1条答案
按热度按时间ntjbwcob1#
订单和列表之间的关联不正确。看看你的眼睛
schema.rb
-有t.string "listing_id"
在orders表中,但它应该是整数。在迁移中更改列类型你需要用上下两种方法
change_column
是不可逆转的