A backdoor into rails 7 asset pipeline?

I’ll try to make this short. Don’t know if this is a bug or a feature.

I decided to see if I could transition an old blog I wrote in Jeykll years ago to a simple Rails blog. More or less something like the Rails 7 intro demo app. Basically just an Article model with a content and title. Rather than use action text, I used marked.js with a stimulus controller that did the conversion. This was a new rails app using importmaps.

I copied a few Jeykll posts and created articles. All worked fine, except images. I tried every way I could thing of to access and image with a markdown image tag (or just an html img tag) and nothing worked. I did get it to work by creating a simple image server on my staging server, but that didn’t feel right for about 30 images.

I did have a slim plugin in the jekyll app and it would render slim with a image_tag call, but no pure img.

I decided to give it another try and see if I could find a way to set src=“xxx” to something that worked.

I copied my images folder from the Jeykll app to my rails app to(under) app/assets/images, so I had app/assets/images/images.

One of my articles has a bunch of different attempts to display the image. Low and behold, one of them worked.

![Home, 1930's](/assets/images/houseMid30s.jpg "1105/07 Eisenhower Dr, Russellton PA")

I assume bin/dev must be doing this, but why to an images folder inside the images folder. I doubt if this will work in production and i’m not where ready to deploy this. In my header, only the images that were loaded showed up.

Again, looks like a backdoor!

After many hours of trying to figure out how to access an image using a <img …> tag, I think I’ve narrowed it down.

The path is starts with ‘’/assets/" followed by the relative folder path to the image. In my link images was a directory in the app/assets/images directory. Followed by the image file name. I just happened that add another images directory that was confusing me.

Still have not found and clear documentation on this approach - its all about the image_tag helper, which I can’t use in markdown.

I would put the images in /public/assets/images/ so they aren’t digested by the asset pipeline (sprockets / propshaft) and can be referenced by their path directly, e.g. <img src="/assets/images/cat.jpg" />