0
我試圖創建在軌一個下拉框,我得到一個錯誤,我跳,有人可以提供一些線索,爲什麼。Rails中創建下拉框表單
以下是錯誤:
undefined method `bot_id' for #<Robot:0x007fa1d663cac0>
機器人類:
class Robot < ActiveRecord::Base
attr_accessible :color1, :color2, :image, :name, :speed, :weapon_damage, :weapon_slots, :bot_id
ROBOT_TYPES = Hash.new("Mini Bot" => "1", "Micro Bot" => "2", "Macro Bot" => "3")
....
end
形式:
...
<div class="field">
<%= f.label :bot_id %><br />
<%= f.select :bot_id, Robot::ROBOT_TYPES%>
</div>
...
$捆綁高管耙分貝:遷移 – 2013-05-12 04:28:23
我做了分貝:遷移,你在暗示我包含bundle exec? – BlackHatSamurai 2013-05-12 04:29:16
我試過了,並沒有工作:( – BlackHatSamurai 2013-05-12 04:30:03