This is my Application.Scala
package controllers
import play.api._
import play.api.data.Form
import play.api.mvc._
import _root_.scala.xml.Text
object Application extends Controller {
def index = Action {
Redirect(routes.Application.tasks)
}
def deleteTask(id: Long) = TODO
val taskForm = Form(
"label" -> nonEmptyText
)
def tasks = Action {
Ok(views.html.index(Task.all(), taskForm))
}
def newTask = Action { implicit request =>
taskForm.bindFromRequest.fold(
errors => BadRequest(views.html.index(Task.all(), errors)),
label => {
Task.create(label)
Redirect(routes.Application.tasks)
}
)
}
}
I'm using play 2.0 framework. Where am I going wrong to get such an error?