title: How do I correctly make a select list in a form_for in rails 4?
body: <p>I'm a rails beginner on rails 4. I am trying to make a wine list and have a wine model that has three attributes, :name, :year, and :type. For the :type i have created a select list of options that include different varietals of wine. When ever I try and create a new wine, I get the exception <code>Invalid single-table inheritance type: Merlot is not a subclass of Wine</code> (I chose "Merlot" from my select list). Im not sure what I'm doing wrong. Here is my wine schema from schema.rb..</p>
  
  <pre><code>create_table "wines", force: true do |t|
      t.integer  "year"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "name"
      t.string   "type"
    end
  </code></pre>
  
  <p>And here is my new wine form ..</p>
  
  <pre><code>&lt;%= form_for @wine do |f| %&gt;
      &lt;%= render "layouts/errors", object: @wine %&gt;
      &lt;div class="form-group input-group input-group-lg"&gt;
          &lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-glass"&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;%= f.text_field :name, placeholder: "What's the wine name or vinyard?", class: "form-control input-lg" %&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;%= f.label :year, "Select year" %&gt;
          &lt;%= select_year Date.today, {start_year: Time.now.year, end_year: Time.now.year - 90, field_name: :year, prefix: :wine}, {class: "form-control"} %&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;%= f.label :type, "Select type" %&gt;
          &lt;%= f.select :type, options_for_select(Wine::TYPES), { include_blank: false }, { class: "form-control" } %&gt;
  
      &lt;/div&gt;
      &lt;div class="form_group"&gt;
          &lt;%= f.submit "Add it", class: "btn btn-success btn-block" %&gt;
      &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>my wine model ..</p>
  
  <pre><code>class Wine &lt; ActiveRecord::Base
      validates :name, presence: true, uniqueness: { case_sensitive: false }
      TYPES = [
                ["Cabernet Sauvignon"],
                ["Chardonnay"],
                ["Zinfandel"],
                ["Merlot"],
                ["Sauvignon Blanc"],
                ["Syrah/Shiraz"],
                ["Pinot Gris/Grigio"],
                ["Malbec"],
                ["Petite Sirah"],
                ["Pinot Noir"],
                ["Riesling"],
                ["Champagne/Sparkling Wine"],
                ["White Zinfandel"],
                ["Blend"],
                ["Other"]
              ]
  end
  </code></pre>
  
  <p>and my wines_controller.rb</p>
  
  <pre><code>class WinesController &lt; ApplicationController
    before_action :set_wine, only: [:show, :edit, :update, :destroy]
  
    def index
      @wines = Wine.all
    end
  
    def new
      @wine = Wine.new
  
    end
  
    def create
      @wine = Wine.new(wine_params)
      if @wine.save
          flash[:notice] = "Successfully created..."
          redirect_to @wine
      else
          flash.now[:error] = "There was a problem"   
          render "new"
      end
    end
  
    def show
    end
  
    def edit
    end
  
    def update
      if @wine.update(wine_params)
          redirect_to @wine
      else
          flash[:error] = "Something went wrong"
          render "edit"
      end
    end
  
    def destroy
      @wine.destroy
      redirect_to wines_path
    end
  
    private
  
      def set_wine
          @wine = Wine.find(params[:id])
      end
  
      def wine_params
          params.require(:wine).permit(:name, :year, :type)
      end
  end
  </code></pre>
  
  <p>Can anyone see what I'm doing wrong? Thanks.</p>