polymorphic_path builds on the work in polymorphic_url which is just another component of the Rails framework. Methods such as form_for, url_for and redirect_to methods all utilise polymorphic_url to generate their paths.
If you find your view logic getting cluttered with if statements like the above, and you're willing to take a hit on the readability of your path in exchange for cleaner looking views or controller actions, polymorphic_path is your friend.