pm9999

pm9999

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”}]])])

First Post!

svmbrown

svmbrown

Author of Web Development with Clojure

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.

Popular Pragmatic topics Top

New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
joepstender
The generated iex result below should list products instead of product for the metadata. (page 67) iex> product = %Product{} %Pento....
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New

Latest in PragProg

View all threads ❯