Asher G.
Asher G.

Reputation: 5001

Displaying an image using Play

I want to display a picture such as for a background for a website or for a container(div). I have been trying to use . I get the error: No route able to display file /public/images/logo.png (file not found) was found.

Upvotes: 1

Views: 1239

Answers (1)

Codemwnci
Codemwnci

Reputation: 54924

So, from your description, I assume that in your view somewhere you have

<img src="@{'/public/images/logo.png'}" />

If you are getting a routes error, it is because the file does not exist. So, check a few things.

  1. Check the file exists in the /public/images directory
  2. Check that the case (uppercase/lowercase) is correct, as linux OS's will complain
  3. check you have not deleted the route for public static assets in your routes file
  4. Check your routes file has not superseded the public route with a different entry further up.

Upvotes: 2

Related Questions