I created a new project using the play console
now, by default I got in my views directory two files:
main.scala.html
index.scala.html
I want to add a new view file. I call it “forums.scala.html”
now, I know that in order to render a view you need to do this:
views.html.forums.render("Forums");
the problem is that the intellisense doesn’t recognize “forums”
but index and main it does recognize.
I’ve noticed those files:
class_managed/views.html/index.class
class_managed/views.html/main.class
but there is no forums.class so I suspect this is the problem.
I tried to build the project, but it didn’t help.
so, what is the solution?
thanks
Your new views are compiled to managed sources after next browser hit if you are using
play runfor starting Play in dev mode.If you’ll use
play ~runit will try to compile it as soon at it will recognize change in the file.Finally if you started your app in production mode ie. via
play startyou have to stop it withctrl+cand run again. Anyway, developing application in production mode is just a bad idea 🙂Depending on your IDE most probably you’ll need to refresh file structure to allow it find freshly created managed sources.