я все делал точно по книжке, как это можно исправить?
вот сам темплейт на который ругается index.scala.html
@main("Task Tracker") {
<h2>Task Tracker</h2>
<div>
<form>
<input type="text" name="taskName" placeholder="Add a new task" required>
<input type="submit" value="Add">
</form>
</div>
}
а вот класс модели Task
package models
case class Task(id: Int, name: String)
object Task {
private var taskList: List[Task] = List()
def all: List[Task] = {
taskList
}
def add(taskName: String) = {
val newId: Int = taskList.last.id + 1
taskList = taskList ++ List(Task(newId, taskName))
}
def delete(taskId: Int) = {
taskList = taskList.filterNot(task => task.id == taskId)
}
}
да, я уже добавил, вот еще SampleAppController и main.scala.html
package controllers
import play.api.mvc.{Action, Controller}
import play.api.templates
import play.twirl.api.Html
class SampleAppController extends Controller {
def index = Action {
val content = Html("<div>This is the content for the sample app</div>")
Ok(views.html.main("Home")(content))
}
def faq = Action {
val content = Html("<div>This is the content from faq</div>")
Ok(views.html.main("Faq")(content))
}
def contactUs = Action {
val content = Html("<div>This is the content from contact us</div>")
Ok(views.html.main("Contact us")(content))
}
def about = Action {
val content = Html("<div>This is the content from about</div>")
Ok(views.html.main("About")(content))
}
}
@(title: String)(content: Html)
<!DOCTYPE html>
<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>