title: processing by create instead of update
body: <p>when I attempt to run my code, I got the error above.
  I try to add specific attributes to my products, but every time I try to add them to my product, a new one is created instead of just edit the old.</p>
  
  <p>Here is the result :</p>
  
  <pre><code>Started POST "/my_products" for 127.0.0.1 at 2016-01-03 16:33:46 +0100
  [localhost] [127.0.0.1] [a6533ae8-475f-4e] Processing by MyProductsController#create as JS
  [localhost] [127.0.0.1] [a6533ae8-475f-4e]   Parameters: {"utf8"=&gt;"✓", "my_product"=&gt;{"size_name"=&gt;"Gros oeuf", "size_img"=&gt;"big-egg.png", "size_price"=&gt;"40"}, "commit"=&gt;"Choisir"}
  [localhost] [127.0.0.1] [a6533ae8-475f-4e]    (0.2ms)  BEGIN
  [localhost] [127.0.0.1] [a6533ae8-475f-4e]   SQL (0.3ms)  INSERT INTO `my_products` (`size_name`, `size_price`, `size_img`, `created_at`, `updated_at`) VALUES ('Gros oeuf', '40', 'big-egg.png', '2016-01-03 15:33:46', '2016-01-03 15:33:46')
  [localhost] [127.0.0.1] [a6533ae8-475f-4e]    (2.0ms)  COMMIT
  </code></pre>
  
  <p>My application_controller.rb :</p>
  
  <pre><code>def current_product
    if !session[:my_product_id].nil?
        MyProduct.find(session[:my_product_id])
    else
        MyProduct.new
    end
  end 
  </code></pre>
  
  <p>My Products_controller :</p>
  
  <pre><code>def base
      @myproduct = current_product
      @size = Size.all
      @chocolate = MyProductItem.where(item_category_id: 1)
  end 
  
  def create
      @myproduct = current_product
      if @myproduct.update(my_product_params)
          redirect_to(:back)
      else
          render 'new'
      end 
  end 
  </code></pre>
  
  <p>My base.html.erb :</p>
  
  <pre><code>&lt;% @size.each do |size| %&gt;
  &lt;div class="Box" &gt;
      &lt;p&gt;&lt;%= size.name %&gt;&lt;/p&gt;
      &lt;p&gt;&lt;%= image_tag size.image, style: 'width:7em;height:auto;' %&gt;&lt;/p&gt;
      &lt;p&gt;&lt;%= number_to_currency size.price %&gt;&lt;/p&gt;
      &lt;p&gt;&lt;%= size.description.try(:html_safe) %&gt;&lt;/p&gt;
      &lt;%= form_for @myproduct, remote: true do |f| %&gt;
          &lt;%= f.hidden_field :size_name, value: size.name %&gt;
          &lt;%= f.hidden_field :size_img, value: size.image %&gt;
          &lt;%= f.hidden_field :size_price, value: size.price %&gt;
          &lt;%= f.submit "Choisir", class: "addtocart", :id =&gt; "#orders" %&gt;
      &lt;% end %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>My models :</p>
  
  <pre><code>class MyProduct &lt; ActiveRecord::Base
    attr_accessible :name, :slug, :price, :image, :my_product_item_id, :user_id, :size_name, :size_img, :size_price
    has_many :elements, dependent: :destroy
    has_one :size, dependent: :destroy
    belongs_to :user 
    belongs_to :order
  
  class Size &lt; ActiveRecord::Base
    attr_accessible :name, :price, :weight, :image, :description, :object_size
    belongs_to :my_product 
  end
  </code></pre>
  
  <p>Any idea ?</p>