There are two asset directory, one is /ui/dist
and the other is /public
. I tried to write the routes like this:
GET /assets/*file controllers.Assets.at(path="/public", file)
GET /ui/*file controllers.Assets.at(path="/ui/dist", file)
But it will throws an error while compiling:
[error] Unspecified value parameter file.
[error] <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
Does anyone have ideas about how to solve this...
I found the key is to pass in another parameter to routes.Assets.at
, the following is from the playframework Asset document
GET /javascripts/*file Assets.at("public/javascripts", file)
GET /images/*file Assets.at("public/images", file)
Then you will need to specify both parameters when using the reverse router:
<script src="@routes.Assets.at("public/javascripts", "jquery.js")"></script>
<image src="@routes.Assets.at("public/images", "logo.png")">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With