diff --git a/app/controllers/HomeController.scala b/app/controllers/HomeController.scala index 7a79ee35..e6af3d5d 100644 --- a/app/controllers/HomeController.scala +++ b/app/controllers/HomeController.scala @@ -1,6 +1,7 @@ package controllers import javax.inject._ + import play.api.mvc._ /** @@ -8,7 +9,8 @@ import play.api.mvc._ * application's home page. */ @Singleton -class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) { +class HomeController @Inject()(cc: ControllerComponents) (implicit assetsFinder: AssetsFinder) + extends AbstractController(cc) { /** * Create an Action to render an HTML page with a welcome message. diff --git a/app/views/index.scala.html b/app/views/index.scala.html index 604eceba..d2884300 100644 --- a/app/views/index.scala.html +++ b/app/views/index.scala.html @@ -1,15 +1,15 @@ @* - * This template takes a single argument, a String containing a - * message to display. + * This template takes a two arguments, a String containing a + * message to display and an AssetsFinder to locate static assets. *@ -@(message: String) +@(message: String)(implicit assetsFinder: AssetsFinder) @* * Call the `main` template with two arguments. The first * argument is a `String` with the title of the page, the second * argument is an `Html` object containing the body of the page. *@ -@main("Welcome to Play") { +@main("Welcome to Play", assetsFinder) { @* * Get an `Html` object by calling the built-in Play welcome diff --git a/app/views/main.scala.html b/app/views/main.scala.html index 9414f4be..2351072f 100644 --- a/app/views/main.scala.html +++ b/app/views/main.scala.html @@ -1,19 +1,20 @@ @* * This template is called from the `index` template. This template * handles the rendering of the page header and body tags. It takes - * two arguments, a `String` for the title of the page and an `Html` - * object to insert into the body of the page. + * three arguments, a `String` for the title of the page and an `Html` + * object to insert into the body of the page and an `AssetFinder` + * to define to reverse route static assets. *@ -@(title: String)(content: Html) +@(title: String, assetsFinder: AssetsFinder)(content: Html)
@* Here's where we render the page title `String`. *@