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

Extending the application requirements in brief


Our pointy-haired marketing wizard (me) has decided that our hipstr application requires the ability to add a new artist and album (with a release date). The form should be validated, ensuring that all of the data is appropriate, before sending it off to the database. If, for whatever reason, the inserts into the database fail, then nothing should be changed. Also, if there are any validation errors with the form, we want to show an appropriate message to the user. Finally, I want to be able to use this form anywhere in the site with minimal modifications and maximum code reuse. (Say whaaaaaaat?!)

Creating the add artist/album form

Let's brainstorm what this magical and revolutionary piece of functionality should look like. Based on what currently exists, the following idea should suffice:

This seems pretty doable, and it satisfies all of our requirements. First things first though: Let's create the HTML for the form.

Creating the form

We'll assume...