Agile Web Development with Rails 7: page 179 the first bullet point has, I believe, a mistake

I agree that with…with is awkward, but I would prefer:

with a div element containing a data-controller attribute naming the controller.