The README describes that elements can also be initialized via the components attributes Hash.
Seems like this feature is not working properly (or missing?).
see README
Another good use case is a navigation component:
# app/components/navigation_component.rb %>
class NavigationComponent < ElementalComponents::Component
element :items, multiple: true do
attribute :label
attribute :url
attribute :active, default: false
end
end
An alternative here is to pass a data structure to the component as an attribute, if no HTML needs to be injected when rendering the component:
<%= component "navigation", items: items %>
I already prepared a PR to make it work - or am I overseening sth. here?
The README describes that elements can also be initialized via the components attributes Hash. Seems like this feature is not working properly (or missing?).
see README
I already prepared a PR to make it work - or am I overseening sth. here?