title: Get resource name from URL when using a custom controller in Rails
body: <p>I have a set of routes that are generated dynamically at runtime, but that all point to the same controller i.e.</p>
  
  <pre><code>map.resources :authors, :controller =&gt; 'main'
  map.resources :books, :controller =&gt; 'main'
  </code></pre>
  
  <p>These all work fine, producing routes like <code>/authors/1</code>, <code>/books</code>, <code>/books/55</code>, etc and then all end up being processed by the 'main' controller. </p>
  
  <p>However, I can't seem to find how to get the name of the resource in the controller i.e. in the index action when the URL is <code>/authors</code> or <code>/books</code> I'd like to be able to determine which resource it is, i.e. Author or Book</p>
  
  <p>I cannot use separate controllers for this.</p>
  
  <p>Is this at all possible ?</p>