views:

77

answers:

1

I have made a application and the logo appears on every page. All 3 of my layouts are copy and pasted to be identical. I have 2 partials linking to 2 pages in the same view folder and the logo works with one and doesn't with the other. It just displays the "alt" name of the <img>. Is there a way to fix this?

+3  A: 

I'd suggest -and I apologise for this- that the obvious answer is that you're not correctly calling the image file.

Check the URI of the image -in the generated (x)html- to make sure that, in the finished page, it's pointing to the correct file. My own issues in these situations tend to be deleting a period (../image.png becomes ./image.png), a typo on the file type (image.png' as image.pgp` -I don't know why) or some other typo-based issue.

I'm sorry I can't be more technical but those are, in my experience, the most common answers.

David Thomas
Let's say you have /products/1/view and /products/list as end points, and you have your image in /images/logo.png. If you use the relative location on your template i.e. ../images/logo.png, it will work for /products/list but not for /products/1/view. You should use absolute path like /images/logo.png on both templates.
Igor
Isn't your final example a root-relative path, not an absolute path (my understanding is an *absolute* path is of the form "protocol://subdomain.domain-name.tld/directory/file.extension")?
David Thomas
Thanks you Igor it worked perfectly when I deleted the .. on the paths in the templates. Just the answer I'm looking for.
Aaron
Please don't hesitate to accept the answer, then... =p Unless it was @Igor, in which case it'd be only fair to ask him to post his comment as an answer and accept that.
David Thomas