Form_for routing issue

I defined a renew route for membership resources as following :

scope 'users' do
  ....
  resources :memberships  do
    member do
      post 'renew'
    end
  end
 ....

end

which leads to:
renew_membership POST (/:locale)/users/memberships/:id/
renew(.:format) {:action=>“renew”, :controller=>“memberships”}

and in my view , my form helper is written as :
= form_for membership, :url => renew_membership_path(membership) do |
f|

generating the following HTML code :

submitting the form, I get a routing error :

Started POST “/users/memberships/1034/renew” for 127.0.0.1 at
2011-06-30 16:33:08 +0200
Processing by ErrorsController#routing as HTML
Parameters: {“utf8”=>“✓”, “authenticity_token”=>“MDNH/
VmfJHBTgur3lksWEEuU5Rp02v70s8UFGR3hxG4=”, “commit”=>“Renew this
Membership”, “a”=>“users/memberships/1034/renew”}

what could be wrong ?

It seems like you already have a member.

Post works for create. you should be using Put… because it seems like
an update.

Ajit