-
|
The HTML
Has anyone made a component(s) around this they’d share? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I'd recommend doing this by making sources with a renders_many :sources, ->(**params) { tag.source(**params) }I imagine params passed to the initializer for the component would dictate how the I haven't actually seen the |
Beta Was this translation helpful? Give feedback.
Finally got around to this, apologies for the wait! Here you go.
The
sources and theimgare lambda slots that generate the corresponding tags. Note that the interface for this implementation is pretty liberal - any params you specify will be passed to the tag helpers. If you wanted to have a more advanced implementation that validates thesrcsetparam among others, you may want to make components forsourceandimgto allow for that.