activator new sampleapp play-scala で作ったプロジェクトを IntelliJで sbt run すると 「object index is not a member of package views.html」エラー
activator new sampleapp play-scala で作ったプロジェクトを IntelliJで sbt run すると 「object index is not a member of package views.html」エラー
- Compilation completed with 1 error and 0 warnings in 4s 912ms sampleapp/app/controllers/HomeController.scala Error:(21, 19) object index is not a member of package views.html Ok(views.html.index("Your new application is ready."))
ファイル
controllers.HomeController
package controllers import javax.inject._ import play.api._ import play.api.mvc._ /** * This controller creates an `Action` to handle HTTP requests to the * application's home page. */ @Singleton class HomeController @Inject() extends Controller { /** * Create an Action to render an HTML page with a welcome message. * The configuration in the `routes` file means that this method * will be called when the application receives a `GET` request with * a path of `/`. */ def index = Action { Ok(views.html.index("Your new application is ready.")) } }
対処
コマンドラインで sbt run してからなら通った。 タスクの作り方が悪かったんだろうか . .