I tried all sort of variants but I can’t get the stock_name set as a phx-value-ref. What is the correct syntax or do I have to use something totally different here?
I tried <button phx-click="buy" phx-value-ref="<%= stock_name %>">Buy</button> but that creates this error:
== Compilation error in file lib/demo_web/live/clock_live.ex ==
** (Phoenix.LiveView.HTMLTokenizer.ParseError) lib/demo_web/live/clock_live.ex:34:54: expected closing `"` for attribute value
Make sure the attribute is properly closed. This may also happen if
there is an EEx interpolation inside a tag, which is not supported.
Instead of
<div <%= @some_attributes %>>
</div>
do
<div {@some_attributes}>
</div>
Where @some_attributes must be a keyword list or a map.
``