I am using playframework with scala and i am trying to build form but getting following error
"An implicit MessagesProvider instance was not found. Please see https://www.playframework.com/documentation/2.6.x/ScalaForms#Passing-MessagesProvider-to-Form-Helpers" here is my index.scala.html
@(customerForm:Form[Customer])
@import helper._
@main("welcome") {
<h1>Customer Form</h1>
@form(action=routes.Application.createCustomer()) {
@inputText(customerForm("Credit Limit"))
@inputText(customerForm("Customer Name"))
<input type="submit" value="Submit">
}
}
And this is my application controller code
package controllers
import play.api._
import play.api.mvc._
import models.Customer
import play.api.data._
import play.api.data.Forms._
class Application extends Controller {
def customerForm = Form(mapping("Customer Name" -> nonEmptyText,
"Credit Limit" -> number)(Customer.apply)(Customer.unapply))
def index = Action { implicit request =>
Ok(views.html.index(customerForm))
}
def createCustomer = Action { implicit request =>
customerForm.bindFromRequest().fold(
formWithErrors => BadRequest(views.html.index(formWithErrors)),
customer => Ok(s"Customer ${customer.name} created successfully"))
}
}