I was testing that drab library and it worked for me but I have a problem what is in the controller does not change I am doing what is in this link Drab: Server Side User Interface Access of POKE and PEEK counterattack but the initial list that is entered through the controller is not updating me and I do not understand why I am doing the same as in the tutorial, here is my code
defhandler replace_list(socket, _sender) do
IO.inspect("entroooo")
Drab.Live.clean_cache()
{:ok, payments} = Helpers.list_payments()
Drab.Live.poke socket, payments: payments
end
defhandler replace_in_process(socket, _sender) do
Drab.Live.clean_cache()
payments = Helpers.list_transaction()
Drab.Live.poke socket, payments: payments
end
controller:
def index(conn, _params) do
{:ok, payments} = Helpers.list_payments
render conn, "index.html", payments: payments
end
And that’s what happens
I do not change the list that is in the computer but instead enter it at the bottom
index.html.drab:
<button class="button blue-kommit"
type="button"
drab-click="replace_list">
<u>Pending </u>
</button>
<button class="button blue-kommit"
drab-click="replace_in_process">
In_process
</button>
<button class="button blue-kommit"
type="button">
Completed
</button>
<br>
<table>
<%= for payment <- @payments do %>
<%= payment.id %><br>
<% end %>
</table>