Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

William Lynch
William Lynch
5,636 Points

Images won’t show in “how-to-make-a-website”

I'm struggling through the Ruby on Rails tutorial "how-to-make-a-website". I'm trying to display an image using the default "http://port-80-axzaavmp5q.treehouse-app.com/img/numbers-01.jpg" which doesn't work. I'm using the treehouse workspaces program and it does not allow "/" in the filename, so I can’t manually enter the filename. Any help getting this going would be greatly appreciated. Bill

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bill Lynch | Designer</title> </head> <body> <header> <a href="index.html">
<h1>Bill Lynch</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li>

                    </ul>
                </nav>
    </header>

    <section>
        <ul>
            <li>
                <img src="img/numbers-01.jpg" alt="">
            </li>
        </ul>
    </section>
    <footer>
        <p>&copy; 2015 Bill Lynch</p>
    </footer>
</body>

</html>

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

This doesn't seem to be related to Rails or Ruby.

6 Answers

William Lynch
William Lynch
5,636 Points

Hi Bill,

I reviewed your Workspace(s) and located the one that you were referencing. The problem is that your folder where your images are stored was titled 'Img' but your file path was pointing to 'img'. I fixed this by renaming your folder 'img'. You should be all set now. Best of luck to you!

Rune Rapley-Møller
PLUS
Rune Rapley-Møller
Courses Plus Student 24,411 Points

Hi Bill,

Can you maybe post a screenshot of your file structure?

If not, then make sure that you have placed the image inside of a folder called: "img".

There seems to be quite a few people struggling with this tonight - I've seen three, at least.

I totally agree with what Rune suggested and you could look at this too, if that might help.

Cheers,

Steve.

William Lynch
William Lynch
5,636 Points

Bummer That still didn't work. I'm trying get support to help.

Bummer

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bill Lynch | Designer</title> </head> <body> <header> <a href="index.html">
<h1>Bill Lynch</h1> <h2>Designer</h2> </a> <nav> <ul> <li><a href="index.html">Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li>

                    </ul>
                </nav>
    </header>

    <section>
        <ul>
            <li>


                Bummer
                <img src="img/numbers-02.jpg" alt="">




            </li>
        </ul>
    </section>
    <footer>
        <p>&copy; 2015 Bill Lynch</p>
    </footer>
</body>

</html>

Rob Allessi
Rob Allessi
8,600 Points

Hi Bill,

Would you please share your Workspace URL with me? I'll gladly take a look and see if we can figure out what the problem is.

William Lynch
William Lynch
5,636 Points

Also, I would be satisfied if you create a project that runs and then give it me and it runs here. It could be a flaw in my code.

William Lynch
William Lynch
5,636 Points

The answer to this was posted in another thread similar to this. Roughly the directory Img has a cap and mine had img. It works now.

Thanks everyone. The treehouse folks figured it out. Bill