In routes.rb I have
map.resource :user
In one of my templates I want to
link_to 'delete', some_other_user
, :method => :post
I was hoping this would generate a url like
/user/#{some_other_user.id}
but instead get
/user.#{user.to_s}
The only solution I've found is to add a new route
map.delete_user 'users/:id', :controller => 'users', :action => 'destroy', :method => :delete
and then use
link_to 'delete', delete_user_url(user), :method => :delete
This seems a bit hacky, is there a cleaner way?