Why does the form give the error "Only post requests are allowed." when submitted to my action? I know the form is supposed to be a post. the rake routes looks ok. some reason there is a "_method"=>"put" in the reques parameters, would this cause it? how do i change the form code to prevent this?
## Request ## Parameters: {"commit"=>"Save", "_method"=>"put", "authenticity_token"=>"291f0f51779490f481edec3fef506b14a2797263", "address"=>{"address"=>"123 some street, boston, ma"}}
## rake routes verify_edit_club_address POST /clubs/:club_id/addresses/:id/verify_edit {:controller=>"addresses", :action=>"verify_edit"}
## form.html.erb <% form_for([@club, @address], :url => verify_edit_club_address_path(@club, @address)) do |f| -%> <p> <b>Address</b><br /> <%= f.text_area :address %> </p> <p> <%= f.submit "Save" %> </p> <% end -%>
## html of generated form <form action="/clubs/1/addresses/6/verify_edit" class="edit_address" id="edit_address_6" method="post"> <div style="margin:0;padding:0"> <input name="_method" type="hidden" value="put"> <input name="authenticity_token" type="hidden" value="291f0f517..."> </div> <p> <b>Address</b><br> <textarea cols="40" id="address_address" name="address[address]" rows="20"> 123 some street, boston, ma </textarea> </p> <p> <input id="address_submit" name="commit" type="submit" value="Save"> </p> </form>