Book Image

Clojure Web Development Essentials

By : Ryan Baldwin
Book Image

Clojure Web Development Essentials

By: Ryan Baldwin

Overview of this book

Table of Contents (19 chapters)
Clojure Web Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

An exercise!


So far, this chapter has been me giving you step-by-step lists of things to do. So if you're getting bored, I don't blame you. As such, I'm going to assign you some homework. You may have noticed that our recently added albums have a hyperlink for the band name.

Your task, if you choose to accept it (you should, it's super rad), is to create a second page. This page will be an artist's discography page. It will show all the albums by the artist that the user clicked. To accomplish this task you must perform the following steps:

  1. Create the route to serve the artist page.

  2. Create the YeSQL script to select all the albums for a given artist by name.

  3. Create the template to render the list of albums for a given artist.

For example, clicking the Fort Knox Harrington link should produce the following:

Tip

In order to complete this task, you must use Compojure's parameter destructuring – See Chapter 4, URL Routing and Template Rendering, specifically the section on – surprise! – Parameter destructuring...