I am seeking to populate a select list in a form with options for user gender. I have a learning Rails book that uses a similar approach for credit card options by creating an array in the model and then referencing it in the view. Unfortunayely when I use this approach I receive an error referencing the line in my view stating: "uninitialized constant GENDER_OPTIONS"
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :confirmable,
:recoverable, :rememberable, :trackable, :validatable
GENDER_OPTIONS = { "Male" => :true, "Female" => :false, "Unspecified" => :nil}
has_many :discussions
has_many :comments
end
<div>
<%= f.label :gender %><br />
<%= f.select :gender, User::GENDER_OPTIONS %>
</div>