[Play 2.0.x] Getting rid of the trailing slash in a pattern matched url

Posted by & filed under Uncategorized.

Let’s take a look at the following Play! Scala artifacts… Routes (note the option ‘?’ in the regex) GET /contacts/$filter<[a..z]?> controllers.Contacts.list(filter: Option[String]) Contacts controller def list(filter: Option[String]) = Action { // … } View template <a href=”@routes.Contacts.list(None)”>All</a> <a href=”@routes.Contacts.list(Some(“a”))”>A</a> Then… …the reverse routes of the view template are expanded to /contacts/ and /contacts/a. To get… Read more »