I am new to Play Framework, and attempting to build a Todo-list from this manual.
When I try to run the application I get the error:
Compilation Error
error: method render in class index cannot be applied to given types;
My code is (the relevant parts):
MainController.java:
final static Form<Task> taskForm = Form.form(Task.class);
public static Result tasks() {
return ok(
views.html.index.render(Task.all(), taskForm)
);
}
index.sacala.html:
@(tasks: List[Models.Task], taskForm: Form[Models.Task])
I looked around, the closest thread I found was this one, but I was not able to resolve the issue using it (might be due to lack of understanding of the environment / framework...).
One last thing that is worth mentioning:
If I change 'index.sacala.html' to be parameter-less (and change the 'MainController' accordingly, everything works perfectly.
Would appreciate any thoughts about resolving this compilation error.
EDIT:
The Task.all()
code is:
public static List<Task> all() {
return new ArrayList<Task>();
}