scalatra/scalatra-book — pull request #26 by futurechimp (2012-02-26 15:53:52+00:00)
Title: Adding .toSeq:_* to scalate examples.

Hello,

I'm attempting to learn Scalatra but ran into a problem when trying to understand how to use Scalate.

The book examples say to do this in order to set a value for use in the template:

```scala
layoutTemplate("/WEB-INF/views/index.ssp",Map("foo" -> "uno","bar"->"dos"))
```

However this fails with the following compilation errors like the following (this example is for mustache but the problem is true for all render helpers):

```sbt
type mismatch;
[error] found : scala.collection.immutable.Map[java.lang.String,java.lang.String]
[error] required: (String, Any)
[error] mustache("index", Map("foo"->"bar"))
```

The solution is to add .toSeq:_* to the Map. I've updated the Scalatra book with this code:

```scala
layoutTemplate("/WEB-INF/views/index.ssp",Map("foo" -> "uno","bar"->"dos").toSeq:_*)
```

Thanks to casualjim for the tip in irc.