how do i append an image to a dom element using javascript

how do i append an image to a dom element using javascript

https://lmgtfy.com/?q=how+do+i+append+an+image+to+a+dom+element+using+javascript

Thanks I’m trying to write an action cable chat app Eventually I want it to include video but for now I’ve got text working but I don’t have images working yet Do all action cable chat solutions rely on javascript (?) because I notice there’s an app/channels folder and an app/javascript/channels folder Does that mean I don’t need to be using javascript?

The client part requires javascript, the backend part requires no javascript, I strongly recommend you read this https://guides.rubyonrails.org/action_cable_overview.html

Sometimes it looks like you just ask questions without reading about the subject you try to use. The official guide shows you what file goes where.

Yes Thanks I’ll read that I’ve been reading active storage overview trying to work out a better understanding of the attachment/s object how to render attachments because I’m having trouble with it