title: Why am I getting the error "is not included in the list"? (Rails 4)
body: <p>Why am I getting the error "is not included in the list" when I attempt to submit the form? </p>
  
  <p>I am using the inclusion validation helper from active record:</p>
  
  <pre><code>SUBJECTS = ['foo','bar']
  validates :subject, inclusion: %w(SUBJECTS)
  </code></pre>
  
  <p>In my view the select list appears as expected: 
  <img src="https://i.stack.imgur.com/9M5ln.png" alt="enter image description here"></p>
  
  <p>The select markup produced using the form helper is: </p>
  
  <pre><code>&lt;select class="form-control" id="message_subject" name="message[subject]"&gt;
    &lt;option selected="selected" value="foo"&gt;foo&lt;/option&gt;
    &lt;option value="bar"&gt;bar&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;div class="row top25"&gt;
    &lt;%= form_for @message, url: {action: "create"}, html: {role: "form"} do |form| %&gt;
    &lt;fieldset class="fields"&gt;
      &lt;div class="form-group"&gt;
        &lt;%= form.label :name %&gt;&lt;%= @message.errors[:name].join(", ") %&gt;
        &lt;%= form.text_field :name, class: "form-control"%&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
        &lt;%= form.label :email %&gt;&lt;%= @message.errors[:email].join(", ") %&gt;
        &lt;%= form.text_field :email, class: "form-control" %&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;%= form.label :subject %&gt;&lt;%= @message.errors[:subject].join(", ") %&gt;
        &lt;%= form.select(:subject, Message::SUBJECTS,{}, class: "form-control") %&gt;
      &lt;/div&gt; 
  
      &lt;div class="form-group"&gt;
        &lt;%= form.label :body %&gt;&lt;%= @message.errors[:body].join(", ") %&gt;
        &lt;%= form.text_area :body, class: "form-control", rows: "10" %&gt;
      &lt;/div&gt;
    &lt;/fieldset&gt;
  
    &lt;fieldset class="actions"&gt;
      &lt;%= form.submit "Send" %&gt;
    &lt;/fieldset&gt;
    &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Message model:</p>
  
  <pre><code>class Message
  
    SUBJECTS = ['foo','bar']
  
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
  
    attr_accessor :name, :email, :subject, :body
  
    validates :name, :email, :subject, :body, :presence =&gt; true
    validates :subject, inclusion: %w(SUBJECTS)
    validates :email, :format =&gt; { :with =&gt; %r{.+@.+\..+} }, :allow_blank =&gt; true
  
    def initialize(attributes = {})
      attributes.each do |name, value|
        send("#{name}=", value)
      end
    end
  
    def persisted?
      false
    end
  
  end
  </code></pre>