Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with mustache not loading data passed to it. #17

Open
KeithTsui opened this issue Oct 29, 2013 · 3 comments
Open

Issues with mustache not loading data passed to it. #17

KeithTsui opened this issue Oct 29, 2013 · 3 comments

Comments

@KeithTsui
Copy link

Hi,

I have a template that takes in a user context object and renders a mustache template to show either a login link if the object does not exist or an account link if it does.
Sometimes when I deploy my Play application to production, a partial sometimes doesn't seem to pick up the data, even though logging on the server side indicates that I'm passing a valid object to the scala template. I have not yet figured out how to reproduce this consistently but seem to notice it more when the app is restarted.

Any ideas on anything I can use to debug this?

My scala template is this:
@(title: String, appName: String, homepageContext: models.HomepageView)
@import org.jba.Mustache

@main(title, appName) {

@Mustache.render(appName, homepageContext)
}

The template loads the partial like this:
{{> header}}

Here's a watered down version of the partial:
{{#user.firstName}}
Log Out
{{/user.firstName}}
{{^user.firstName}}
Login
{{/user.firstName}}

-Keith

@KeithTsui
Copy link
Author

Forgot to mention that I am using Play 2.1.5 with 1.1.2 of play2-mustache.

@julienba
Copy link
Owner

Just an idea: firstName is an Option ?

@KeithTsui
Copy link
Author

Hi Julien. No. It is not.
case class UserContext(
firstName: String,
....
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants