In the README for the inherited_resources gem it says the below associations allow the use of helpers such as parent #=> @task
class CommentsController < InheritedResources::Base
belongs_to :project {
belongs_to :file, :message, :task, :polymorphic => true
}
end
What isn't explained is the helper itself. Do we know what this looks like, how it works? It would really help my understanding.
Cheers
That gem looks like it's deprecated at this point, but:
What the README is saying is that projects can be a parent to a
:file,:message, or:task. Furthermore any of those can be a parent to own:comment.Where this could be useful, is you could call any of those helpers on the
:commentto get information about its parent. For example you could write a conditional statement to deal with a:commentin different ways differently depending on whether it's parent object was a :file or a :task. Here's a random example: