title: inherited resource belongs_to & polymorphic troubles
body: <p>So I am having trouble figuring out what is going on with a polymorphic assoc/inherited resources, and the documentation is confusing me as I don't know exactly what part of it means -- in the documentation it states:</p>
  
  <p>Right now, Inherited Resources is limited and does not allow you to have two polymorphic associations nested.</p>
  
  <p>But it goes on to show this example.</p>
  
  <p>You can even use it with nested resources:</p>
  
  <pre><code>  class CommentsController &lt; InheritedResources::Base
      belongs_to :project do
        belongs_to :task, :file, :message, :polymorphic =&gt; true
      end
    end
  </code></pre>
  
  <p>-- My code is similar, but basically, I need projects to be commentable, as well as tasks, which is nested below projects. -- But the code above only semi works if I do the following:</p>
  
  <pre><code>  class CommentsController &lt; InheritedResources::Base
  
      belongs_to :project, :polymorphic =&gt; true do
        belongs_to :task, :polymorphic =&gt; true
      end
  
    end
  </code></pre>
  
  <p>But when I do the above, I am still losing methods like parent?, within my project views, which I need to use in order to determine if the resource is a project, or a task, so that I can call the correct params in the form partial (because I have project comment form in one tab, and then a tab for tasks, which is ajax loaded in with a form to comment on that task) -- </p>
  
  <p>So I am wondering if what I am doing above is exactly the limitation the documentation is referring to, (but the thing is, when I nest it like above, I am then able to post comments for both projects and tasks, if I dont then I get a could not find polymorphic association error, so it seems like it is sort of working, minus the missing methods), and if that is not the right way to nest this setup, if anyone has any creative workaround ideas.</p>