
Mung
Modern CSS with Tailwind: Image_pack_tag
Title: Modern CSS with Tailwind: exception raised on image_pack_tag (page 4)
The text in the book about this helper leaves much to be desired:
<%= image_pack_tag(“media/images/music.svg”, size: “100x100”) %>
(For what it’s worth, image_pack_tag is a Rails and Webpacker thing; you may
need to do something else to find the image.)
Where should the image be found? Due to the exception I can’t see what image_pack_tag returns in the way of HTML. Do I need to change where the image is located? Do I need to change the url? Where is the media directory located?
First Post!

noelrappin
What exception do you get? image_pack_tag
returns an HTML img
tag with a source URL that goes through Webpacker to get the location of the image.
Exactly what you’d need to do in the general case depends on how your media files are set up in your app.
Popular Prag Prog topics










Other popular topics









Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /react-native
- /textmate
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /c
- /julia
- /neovim