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

Java Spring Basics Creating Controllers and Views The Gift of Design

Roman Mayer
Roman Mayer
10,925 Points

Code in zip-file is different from code in video

The code in the zip-file is different from the code in the video. In home.html, towards the end. In the video you "manually" show 3 <div>s with the robot gif:

    <div class="gifs container">
        <div class="row">
            <div class="col s12 l4">
                <a>
                    <img th:src="@{/gifs/compiler-bot.gif}" />
                    <a href="#" class="mark favorite"></a>
                </a>
            </div>
            <div class="col s12 l4">
                <a>
                    <img th:src="@{/gifs/compiler-bot.gif}" />
                    <a href="#" class="mark favorite"></a>
                </a>
            </div>
            <div class="col s12 l4">
                <a>
                    <img th:src="@{/gifs/compiler-bot.gif}" />
                    <a href="#" class="mark favorite"></a>
                </a>
            </div>
        </div>
    </div>

whereas in the zip-file, you use Thymeleaf's for-each loop:

    <div class="gifs container">
        <div class="row">
           <div th:each="gif : ${gifs}" class="col s12 l4">
                    <a th:href="@{'/gifs/' + ${gif}}">
                        <img th:src="@{'/gifs/' + ${gif.name} + '.gif'}" />
                        <a href="#" th:class="(${gif.favorite} ? 'un' : '') + 'mark favorite'"></a>
                </a>
            </div>
        </div>
    </div>

The loopy version doesn't really work for me. When I run this code, I only see the nav-bar and the search-field. No gifs listed.

D T
D T
10,092 Points

Same here. The loopy version doesn't really work. The other one works fine!

Thank you

Claudiu Haidu
Claudiu Haidu
3,909 Points

Does anyone have an answer to the loopy thing?

3 Answers

Yes, this needs to be fixed!

Rebekah Smith
Rebekah Smith
7,263 Points

Does not reproduce.

The zip file I downloaded looks like what Chris shows. The loopy part is in favorites.html, and the manual 3 divs are in home.html.

Home displays as expected, same as what Chris shows. We haven't yet added request mapping for the favorites page that contains the loopy part.

The code is indeed different than in the video.

There are two separate versions of the resources folder available on this page. One works with the current version of the controller and config, the other doesn't. The correct version is on the first tab, the non-working version is in the 'downloads' tab.

alastair cooper
alastair cooper
30,617 Points

The point made by Will Burchard on Mar 15, 2018 is still valid as of 27 June 2020.

USE THE DOWNLOADS FROM THE LINK ON THE FIRST TAB, NOT THE DOWNLOADS SECTION