在我的controller.rb中,我有以下代码:
@teams = Team.all
这是一些示例输出:
<Team id: 1, name: "Eastside", nick: "Bunnies", api_team_id: 3235, created_at: "2013-01-18
21:19:24", updated_at: "2013-01-18 21:19:24">
<Team id: 2, name: "Westside", nick: "Turtles", api_team_id: 3235, created_at: "2013-01-18
21:19:24", updated_at: "2013-01-18 21:19:24">
<Team id: 3, name: "Northside", nick: "Birds", api_team_id: 3235, created_at: "2013-01-18
21:19:24", updated_at: "2013-01-18 21:19:24">
如何创建一个下拉列表,显示每个项目的 Team.name 和 Team.nick?另外,我如何才能链接到团队各自的 team.id?