My app (like so many others) has an admin section, which uses controllers inside an admin directory. To keep it simple, I'm only administering the User resource for now. I have a controller that looks like this:
<code> class Admin::UsersController < ApplicationController # normal scaffold methods in here end </code>
I've also added the following lines to my routes.rb file:
<code> map.namespace :admin do |admin| admin.resources :users end </code>
In my admin/users/index view, I'd like to be able to use link_to to create a delete link for each user. If I wasn't using subdirectories, it would be like this:
<code> <%= link_to "Delete", user, :confirm => "Are you sure?", :method => :delete %> </code>
When I put this code in admin/users/index, it links to the regular users section (not the admin one), which has no destroy method. How can I make this link to the admin version? Do I need to hardcode the URL into the link_to method, or is there a cleaner way that I don't know about?
Thanks -Jake