play-scala-starter-example
play-scala-starter-example copied to clipboard
This repo and the tutorial on the website are out of sync. Tutorial code will not compile.
The link to download this repo located here (as of 2019-03-12) as 'Play Starter Example Project' is out of sync with the rest of the tutorial that follows. This leads to the project being unable to compile if the instructions are followed exactly.
For example, the instructions for making the hello.scala.html
here:
@main("Hello") {
<section id="top">
<div class="wrapper">
<h1>Hello World</h1>
</div>
</section>
}
will not work because the main.scala.html
template expects another explicit parameter which is an AssetsFinder
. From source file here:
@(title: String, assetsFinder: AssetsFinder)(content: Html)
The solution is that you need to accept this parameter as an implicit and then pass it to main
explicitly like so:
@()(implicit assetsFinder: AssetsFinder)
@main("Hello", assetsFinder) {
<section id="top">
<div class="wrapper">
<h1>Hello World</h1>
</div>
</section>
}
Long story short, I think that either the download link or the tutorial instructions need to be updated in order to resolve this issue.