Web Development with Clojure, Third Edition: missing refer and more page277-278 P1.0

Dmitri Sotnikov @dmitri and Scot Brown @svmbrown

On page 277 image-uploader needs to be referred to from components

;;…
[:div.field
[:div.control
[image-uploader
#(rf/dispatch [:message/save-media %])
“Insert an Image”]]]
;;…

On page 278 I sense that we are only trying to update the code of submit button not the whole message-form as shown:

(defn message-form
[:div.card
[:div.card-header>p.card-header-title
“Post Something!”]
(let [{:keys [login profile]} @(rf/subscribe [:auth/user])
display-name (:display-name profile login)]
[:div.card-content
[:input.button.is-primary.is-fullwidth
{:type :submit
:disabled @(rf/subscribe [:form/validation-errors?])
:on-click #(rf/dispatch [:message/send!
@(rf/subscribe [:form/fields])
@(rf/subscribe [:message/media])])
:value “comment”}]])])

Hi, that seems to be an issue with the code snippet generation.

Please see the source code for the full message-form body here.

I’ll see what I can do about getting an update published as soon as possible.

In case you’re unable to see the content of the link, the form control we wrote to insert an image should be included inside the :div.card-content element of message-form, along with the :div.field that contains the textarea-input from guestbook.components.

Apologies for the confusing error. Thanks for bringing it to our attention.

FYI: In the PDF version of the book, the filenames above the code blocks are clickable, and will let you view the entire namespace they are taken from.