Skip to content

Instantly share code, notes, and snippets.

@julienrf
Created April 15, 2012 19:54
Show Gist options
  • Select an option

  • Save julienrf/2394512 to your computer and use it in GitHub Desktop.

Select an option

Save julienrf/2394512 to your computer and use it in GitHub Desktop.
object Application extends Controller with PathLang {
def index = Ok(html.index())
}
trait PathLang extends Controller {
override def lang(implicit request: RoutedRequest) =
request.pathParams.get("lang").map(Lang(_)).getOrElse(super.lang)
}
GET /:lang/index controllers.Application.index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment