title: Rendering error messages for form_tag that creates multiple objects?
body: <p>I'm not sure how to display the error messages for my form when using it in this <code>form_tag</code> scenario. My code below allows me to create 5 products at once on a form but unfortunately only renders the notice that "an error occurred...".</p>
  
  <p>Here is my code:</p>
  
  <p><strong>Product.rb</strong></p>
  
  <pre><code>class Product &lt; ActiveRecord::Base
    attr_accessible :price, :name, :purchase_date, :product_store, :in_category
    belongs_to :user
    belongs_to :store
    attr_reader :product_store
    validates_inclusion_of :in_category, :in =&gt; [true, false]
    validates_presence_of :name, :price, :store_id, :user_id
    validates_numericality_of :price
  
    def product_store=(id)
      self.store_id = id
    end
  end
  </code></pre>
  
  <p><strong>Products_controller.rb</strong></p>
  
  <pre><code>class ProductsController &lt; ApplicationController
  
    def new
      @products = Array.new(5) { Product.new }
    end
  
    def create_multiple
     @products = current_user.products.create(params[:products].map { |_k, p| p.merge params[:product] })
      if @products.each(&amp;:save)
         redirect_to :back, :notice =&gt; "Success!"
      else
         redirect_to :back, :notice =&gt; "An error occured, please try again."
      end
    end
  end
  </code></pre>
  
  <p><strong>Form.html.erb</strong></p>
  
  <pre><code>&lt;%= form_tag create_multiple_products_path, :method =&gt; :post do %&gt;
      &lt;%= error_messages_for @product  %&gt; 
  
         # the :purchase_date and :in_category are merged into all 5 Products.
  
              &lt;%= date_select("product", "purchase_date")  %&gt; 
  
              &lt;%= label_tag :in_category, 'Add to Category?' %&gt;
                &lt;%= radio_button("product", :in_category, 1) %&gt;
                &lt;%= radio_button("product", :in_category, 0) %&gt;
  
              &lt;% @products.each_with_index do |product, index| %&gt;
                 &lt;%= fields_for "products[#{index}]", product do |p| %&gt;
                     &lt;%= render "fields", :f =&gt; p %&gt;
                 &lt;% end %&gt;
              &lt;% end %&gt;
  
         &lt;%= submit_tag "Done" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Theirs 2 issues. 1. Getting the validations for the fields outside of the <code>fields_for</code> to show .2. And then the ones inside of the <code>fields_for</code>. How could I do this? </p>
  
  <p>Thank you.</p>