爲什麼我的程序試圖找到teamplayers.player_id(不存在)試圖運行這條線時:<%= select_tag "test3", options_from_collection_for_select(Teamplayer.joins(:live_player), "teamid", "playerid") %>
找不到在軌列
我想加入的字段playerid(從teamplayers)和NID (來自玩家)。我試圖創建一個foriegn關鍵,但沒有奏效
UPDATE 這裏是我的teamplayers遷移文件,沒有名稱的屬性,在名稱相關的存儲在該表中playerid是在球員表。
class CreateTeamplayers < ActiveRecord::Migration
def change
create_table :teamplayers do |t|
t.string :playerid
t.string :teamid
t.timestamps
end
end
end
你能分享你的數據庫架構嗎? – Rinku
你想要表格或模型的字段? – user3240928