Releases: HectorMF/attrify
Releases · HectorMF/attrify
Release list
Release 0.5.0
Breaking changes in the naming scheme of the DSL.
Ability to set attributes on the fly inside your components:
class MyComponent
variants do
base class: %w[border w-full]
end
def initialize()
variant[:style] = "width:100%"
end
def set_tags(tags)
variant[:data][:tags] = tags.map(&:downcase).join(",")
end
end
# View
<div <%= attributes %></div>
comes out to
<div class="border w-full" style="width:100%" data-tags="...."></divFull Changelog: https://github.com/HectorMF/attrify/commits/0.5.0