phoenix_live_view
phoenix_live_view copied to clipboard
raise when declaring global attr within a slot
I just ran into this issue when trying to define a select input with values. Usage was like this:
~H"""
<.input type="select" field={{f, :energy}} label="Energy Level">
<:option value="" hidden={true}>Select an option</:option>
<:option :for={value <- Ecto.Enum.values(Canvas, :energy)} value={value}>
<%= value %>
</:option>
</.input>
"""
How could I provide the other attributes of an option without having to define each individually? My current idea is using assigns_to_attributes(opt, [:value])
however then there is the compile time warning of passing in attributes which are unknown.