I'm trying to create a drop down box in rails and I'm getting an error and I'm hopping that someone can shed some light as to why.
Here is the error:
undefined method `bot_id' for #<Robot:0x007fa1d663cac0>
Robots class:
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
Form:
...
<div class="field">
<%= f.label :bot_id %><br />
<%= f.select :bot_id, Robot::ROBOT_TYPES%>
</div>
...