Reputation: 969
I am trying to do CRUD on a Category class:
categoryEdit.scala.html:
@(cat: Category, myForm: Form[Category])
@admin(title = "Category") {
@helper.form(action = controllers.Application.categorySave) {
@inputText(myForm("name"))
<input type="submit" value="Save">
}
}
The controller code:
public static Result categorySave() {
// save form data here ...
return redirect(
routes.Application.index()
);
}
Entry in Routes file is as below.
GET /saveCategory controllers.Application.categorySave()
I am getting this error:
type mismatch; found : play.mvc.Result required: play.api.mvc.Call
on this line: @helper.form(action = controllers.Application.categorySave) {
What's wrong in my form? I am missing something?
Upvotes: 1
Views: 2513
Reputation: 10404
How about changing your action?
controllers.routes.Application.categorySave
PS : Mind the routes in the route.
Upvotes: 3