Creating Views in Game Structure 2

I created a package view.inputin the playback structure, and then the form.scala.htmlfile below it. now I want to use the redirection in the class as shown below:

return ok(form.render(somevalue));

here I cannot get the formone I created in views, and therefore I get an error message. why is that so?

Thank.

+5
source share
1 answer

You must try:

return ok(views.html.input.form.render(someValue));

or even:

import views.html.input.form;

...
    return ok(form.render(someValue));
...

but in this case, it’s best to create a view name with a package prefix for the visual that distinguishes them from the views from viewspackage /app/views/input/inputForm.scala.html:

import views.html.input.inputForm;

...
return ok(inputForm.render(someValue));
+6
source

All Articles