Play! framework create a new look

I created a new project using the game console
now, by default, I got two files in my view directory:

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 make a presentation, you need to do this:

 views.html.forums.render("Forums"); 

the problem is that intellisense does not recognize "forums"
but the index and most importantly, what it recognizes.
I noticed these files:

class_managed / views.html / index.class
class_managed / views.html / main.class

but there is no forum forum, so I suspect this is a problem.
I tried to build a project, but that did not help.
so what is the solution?

thanks

+6
source share
4 answers

Your new views will compile to managed sources after the next browser if you use play run to start Play in dev mode.

If you use play ~run , it will try to compile it as soon as it recognizes the changes in the file.

Finally, if you launched the application in production mode, i.e. through play start you need to stop it with ctrl+c and run again. In any case, application development in production mode is just a bad idea :)

Depending on your IDE, most likely you will need to update the file structure so that it can find the newly created managed sources.

+9
source

right-click on the project and click "Update", which worked for me - found it in another thread.

+6
source

Found a solution.
the compilation team did the job.
I realized that intelliJ does this automatically, so I will probably use it instead of eclipse.

Hurrah!

+2
source

If you want to program in scala, my recommendation is to forget about intellisense. The eclipses of scala -ide are pretty bad, don't know about netbeans. And due to the non-standard layout of the play2 application, development tools without std (play console), it becomes even more convenient to use a simple text editor (for example, sublime or textmate) with a good old open-folder-as-project function.

+1
source

Source: https://habr.com/ru/post/921713/


All Articles