Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play! framework. create a new view

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

like image 811
socksocket Avatar asked Jul 30 '12 19:07

socksocket


1 Answers

Your new views are compiled to managed sources after next browser hit if you are using play run for starting Play in dev mode.

If you'll use play ~run it 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 start you have to stop it with ctrl+c and 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.

like image 76
biesior Avatar answered Oct 02 '22 12:10

biesior