Question: i have problem to build the 'link\_to' to action "destroy".

I have two nested routes in 'Routes.rb':

```
  namespace :admin do
    namespace :security do
      resources :users
    end
  end

```

'rake routes' prints:

```
  DELETE /admin/security/users/:id(.:format)               admin/security/users#destroy

```

the controller is: 

```
  class Admin::Security::UsersController < ApplicationController
    def destroy
      ...
    end
    ...

```

**How to build the link\_to with http veb 'delete'?**

I unsuccessful tried:

```
  <%= link_to 'destroy', user, method: :delete %>
  <%= link_to 'destroy', {:controller => "admin/security/users", :action => "destroy", :id =>       user.id}, method: :delete %>
  <%= link_to 'destroy', admin_security_users_path(user), method: :delete %>
  <%= link_to 'destroy', admin_security_user_destroy_path(user), method: :delete %>

```

Answer: 
You could try passing only the action and resources and leave the rest up to rails:

**UPDATE**
 You should use namespaces names as a parameter to `url_for` 

```
<%= link_to 'destroy', ([:destroy, :admin, :security, user]),  method: :delete %>

```
Use this

```
<%= link_to 'destroy', admin_security_user_path(user), method: :delete %>

```

use `admin_security_user_path` and not `admin_security_users_path`

**NOTE:** DELETE is performed on single object of model.  

See the **[Official Rails Routing](http://guides.rubyonrails.org/routing.html#controller-namespaces-and-routing)** Documentation.