title: ActionController::MethodNotAllowed (Only get and post requests are allowed.):
body: <p>Not sure what's going on. I've used the following bit of code to try and edit the name of a category, but I'm getting the error message above. My code for the form and submit for the edit is: -</p>
  
  <pre><code>&lt;% form_for :category, :url =&gt; categories_url(@category),:html =&gt; { :method =&gt; :put } do |f| -%&gt;
  &lt;p&gt;Name: &lt;br /&gt;&lt;%= f.text_field :name, :size =&gt; 60 %&gt;&lt;/p&gt;
  &lt;%= submit_tag 'Save' %&gt; or &lt;%= link_to 'cancel', admin_categories_url%&gt;
  </code></pre>
  
  <p>So pretty straight forward stuff. My controller code is: -
    def edit
      @category = Category.find(params[:id])
    end</p>
  
  <p># PUT /categories/1
    # PUT /categories/1.xml
    def update
      @category = Category.find(params[:id])
      @category.update_attributes(params[:category])</p>
  
  <pre><code>respond_to do |wants|
    wants.html { redirect_to admin_categories_url }
    wants.xml  { render :xml =&gt; @category.to_xm }
  end  
  </code></pre>
  
  <p>end</p>
  
  <p>This code has worked for other things - such as blog articles, so I'm not sure where I{"m going wrong. Help??</p>