In this example, I want to explain a best practice for Polymorphic URLs in Rails. I will show really bad things here as an illustrative example. Don’t worry, we will refactor the code later ;-) Let us assume that we have three models, Post, News and Comment. In most cases, a post has many comments […]

Read more at the source