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

Assets.versioned instead of Assets.at #44

Open
muuki88 opened this issue Jul 4, 2014 · 1 comment
Open

Assets.versioned instead of Assets.at #44

muuki88 opened this issue Jul 4, 2014 · 1 comment

Comments

@muuki88
Copy link

muuki88 commented Jul 4, 2014

Webjars-play only supports the Assets.at route (located in the nastyReflection).

If I have an assets route like this

GET    /assets/file     controllers.Assets.versioned(path="public", file: Asset)

Results in an InvocationTargetException, because the at method is not there.

@jamesward
Copy link
Member

I think that I might just remove that functionality because it is pretty brittle. Here is what you can use instead:

    <script>
        @play.api.Play.current.configuration.getString("assets.url").fold {
            @Html(org.webjars.RequireJS.getSetupJavaScript(routes.WebJarAssets.at("").url))
        } { assetsUrl =>
            @Html(org.webjars.RequireJS.getSetupJavaScript(StaticWebJarAssets.url(""), routes.WebJarAssets.at("").url))
        }
    </script>
    <script data-main="@routes.Assets.versioned("javascripts/app.js")" src="@StaticWebJarAssets.url(WebJarAssets.locate("require.min.js"))"></script>

From: https://github.com/jamesward/salesforce-webhook-creator/blob/master/app/views/app.scala.html

LMKWYT

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