After the download from http://download.playframework.org/releases/play-2.0.zip is installed as usually, I rename the /play script to /play20 to ensure using the right version.
Projects done with release candidates of Play 2.0 have to be upgraded by changing the last line of /project/plugins.sbt:
addSbtPlugin("play" % "sbt-plugin" % "2.0")Below you find a number of snippets you may find helpful:
- Iterate over collection
- Play1: #{list items:collection, as:'var' } ...$var... #{/list}
- Play2: @for(var <- collection) { ... @var ... }
- Insert relative URL in template:
- Play1: @{controller.method}
- Play2: @routes.Controller.method()
- Insert absolute URL in template:
- Play1: @@{controller.method}
- Play2: http://@request.headers().get("HOST")@routes.Controller.method()
- URL to file in public:
- Play1: @{'/public/images/logo_16x16.png'}
- Play2: @routes.Assets.at("images/logo_16x16.png")
EDIT: This went into the play 2.0 wiki: https://github.com/playframework/Play20/wiki/Play-2.0-for-Play-1.x-developers