title: Subdomain for nested resources in Rails
body: <p>My rails app is set to use subdomains as described in this RailsCast:</p>
  
  <p><a href="http://railscasts.com/episodes/221-subdomains-in-rails-3" rel="nofollow">http://railscasts.com/episodes/221-subdomains-in-rails-3</a></p>
  
  <p>However, right now, paths render like this:</p>
  
  <p><a href="http://organization.domain.com/organizations/1/edit" rel="nofollow">http://organization.domain.com/organizations/1/edit</a></p>
  
  <p>I have the controllers set up to choose the organization based on the subdomain already, so I'm wondering if there's a way to strip out the /organizations/:id portion of the paths, such that:</p>
  
  <pre><code>link_to edit_organization(@organization)
  </code></pre>
  
  <p>goes to <a href="http://organization.domain/edit" rel="nofollow">http://organization.domain/edit</a>, instead of <a href="http://organization.domain/organizations/:id/edit" rel="nofollow">http://organization.domain/organizations/:id/edit</a></p>
  
  <p>Since there's going to be many nested resources within organizations (people, donations, etc), it's important that URL's don't end up incredibly long, and that the path generation method remains pretty straightforward.</p>
  
  <p>Is there a way to do this?</p>