title: Rails - Routing Error 'No route matches [PUT]'
body: <p>I'm trying to make a small app that allows users to create a sale. There is a user model product model and photo model. A user has many products and products has many photos. But for some reason after I try to create a product page I get this error.</p>
  
  <p><strong>Routing Error</strong></p>
  
  <pre><code>No route matches [PUT] "/products"
  </code></pre>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>  resources :products
    resources :photos
  </code></pre>
  
  <p><strong>products controller</strong></p>
  
  <pre><code>  def new 
      @product = Product.new
      @photo = Photo.new
    end
  
    def create
      @product = current_user.products.build(params[:product])
      @photo = current_user.photos.new(params[:photo])
  
      if @product.save &amp;&amp; @photo.save
        @photo.product_id = @product.id
        render "show", :notice =&gt; "Sale created!"
      else
        render "new", :notice =&gt; "Somehting went wrong!"
      end
    end
  
    def show
      @product = Product.find(params[:id]) 
    end
  </code></pre>
  
  <p><strong>new product page (HAML)</strong></p>
  
  <pre><code>%h1 
    create item
  
  = form_for @product,:url =&gt; products_path, :html =&gt; { :multipart =&gt; true } do |f|          
    %p
      = f.label :name
      = f.text_field :name
  
    %p
      = f.label :description
      = f.text_field :description        
      = f.text_field :ship_price
  
    %p
      = fields_for :photo, :html =&gt; {:multipart =&gt; true} do |fp|
      = fp.file_field :image  
  
    %p.button
      = f.submit
  </code></pre>
  
  <p><strong>rake routes</strong></p>
  
  <pre><code>       products GET    /products(.:format)               products#index
                  POST   /products(.:format)               products#create
      new_product GET    /products/new(.:format)           products#new
     edit_product GET    /products/:id/edit(.:format)      products#edit
          product GET    /products/:id(.:format)           products#show
                  PUT    /products/:id(.:format)           products#update
                  DELETE /products/:id(.:format)           products#destroy
  </code></pre>
  
  <p>Shouldn't this work if I already did resources:products !?</p>