polymorphic_url is very useful if you want to create an universal partial that works for more than 1 type of object passed to it.
For example in you sidebar you might have a _sidebar.html.erb partial that’s supposed to display links to “Edit” and “Delete” actions. You can write it in such a way that it can be reused for different types of objects (in the example below we pass either a Post or a Note).
your_template.html.erb
<%= render :partial =>'shared/sidebar',:locals=>{:obj=>Post.new-%>
other_template.html.erb
<%= render :partial =>'shared/sidebar',:locals=>{:obj=>Note.new-%>
_sidebar.html.erb
<%= link_to "Edit", polymorhpic_url(obj, :action =>'edit')-%><%= link_to "Delete", polymorphic_url(obj), :method =>:delete-%>