Using scalate with play 2.1.1

150 views
Skip to first unread message

Matthew de Detrich

unread,
Jul 2, 2013, 9:21:16 PM7/2/13
to sca...@googlegroups.com
I am attempting whether or not to use Play framework (coming from Rails) and I would really like to use Scalate with play (as it provides both haml and jade converters)

When I however click on the home page, it links to a git repo that no longer exists (https://github.com/pk11/play-scalate)

Does anyone know if there is proper support for scalate within the play framework?

Rafał Krzewski

unread,
Jul 14, 2013, 11:34:25 AM7/14/13
to sca...@googlegroups.com
That particlar project seems to be gone. Scalate website needs to be updated. However a search on github https://github.com/search?q=play-scalate
Reveals a number of projects that attempt to integrate Scalate into Play / Play2. I have no idea who is working on them and how they are doing.
It would be great if you could try some of those projects and report to this list if you find something's that works :)

Cheers,
Rafał

Matthew Farwell

unread,
Jul 14, 2013, 3:56:58 PM7/14/13
to sca...@googlegroups.com
This is not a definitive answer to the question, but for sbt in Action the book that I'm writing with Josh Suereth, we use play with Scalate in chapter 4 - Testing. The code source is here: https://github.com/jsuereth/sbt-in-action-examples. Look in the chapter4 directory.

As I said - this will give you an idea of how it's done, don't take this as THE way to do this. For information, we're also using the play-navigator to replace the Routes file, but you can probably ignore that bit as well.

Matthew Farwell.


2013/7/14 Rafał Krzewski <rafal.k...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Scalate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalate+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pirkka Jokela

unread,
Jul 16, 2013, 6:11:26 PM7/16/13
to sca...@googlegroups.com
Hi,

We started using Play 2.1 a few months ago and we evaluated templating options back then. I was able to hook Scalate up with Play 2.1. I used scalate mustache and the idea was to use mustache with Play and on the browser too. This really didn't work too well.

- The mustache in scalate is not the same as the mustache in JS. There were small and large differences that made the "same template language on server and browser" just not work.

- When Scalate was hooked up with Play, you need to be very careful with the stuff you pass to the templates. Instead of normal Scala objects I needed to build weird map like structures. That was awful.

- Finally, scalate is runtime. The greatest thing about the Play internal template system is that it is compiled. This has already been a great thing, because I can change the stuff passed from controllers to templates and the compiler makes sure I fix all the problems. With Scalate you pass an object tree to the template and maybe it works, maybe it doesn't. You need to test all your web pages.

So, our solution was to stick with the Play templates and so far they have been great.

Br,

    Pirkka
Reply all
Reply to author
Forward
0 new messages