Coder Social home page Coder Social logo

review-site-instructions's Introduction

Reviews Site

Module Resources

Opinions. You know the saying...everyone has one. And the Internet has made them easier to consume, or ignore.

Acquisitions, Inc. has many, many products from its years of, well, acquiring things. They have asked you to build a reviews site for some of their current products. The data gathered will help them gain insight into their customer base and the products they have come to enjoy...or enjoy less.

Acquisitions, Inc. requires:

  • Development of a MVC Web Application that practices agile methodology, utilizes test driven design, and values clean code
  • Appropriate use of Git and access to your application on GitHub
  • Useful instructions in the form of a README.md file

Materials

Deliverables

  • Create a Review class for the content of reviews. Its properties should include: id, title, imageUrl, reviewCategory (singular), content
  • Create a ReviewRepository
    • It should have a constructor that houses a List of Reviews
    • should have a method to find all reviews
    • should have a method to find one review by id
  • Create a ReviewsController class.
    • It should have a method mapped to a url outputs all reviews
    • should have a method mapped to a url including an id parameter that outputs the details of a single review

Thymeleaf Tips

Iteration

We use th:each to iterate over collections in Thymeleaf. If I had a collection called widgets in my model, each of these having a name attribute, I would do the following to generate a <div> for each of these. widget is the name of my iteration variable, much like the for each loops you're familar with:

<div th:each="widget: ${widgets}" th:text="${widget.name}" />

This would result in something like the following, given the names "fee", "fie", and "foe":

<div>fee</div>
<div>fie</div>
<div>foe</div>

(See the tutorial section on iteration.)

Link URLs

Link urls have a special syntax in Thymeleaf, the @ syntax: @{...}. If I had an object called foo in the model, with a getId() method, and wanted to create a query parameter with the id, I would reference it as follows:

<a th:href="@{/things/${thing.id}}">link text</a>

This would result in the following being rendered, assuming that thing.getId() returns 42:

<a href="/things/42">link text</a>

(See the tutorial section on link urls.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.