Enable/disable a button in Phoenix 1.7 depending on state

Not really. If you’re pulling out values out of assigns.rest you’re doing something wrong. The attribute shouldn’t be put into the catch all @rest in the first place, but be an explicit attr.

attr :disabled, :boolean, [opts]
attr :rest, :global, [opts]

def button(assigns) do
  # assigns[:disabled] or assigns.disabled (if you configure a default or the attr is required)
  …
end

Are you sure this is not releated to your :rand usage / function call? Do things work if you manually pass true or false?