I wrote this sample project to get more familiar with LiveView, but it gives me this error on going to the live route
assign @temp not available in eex template.
here is my code
defmodule ThermoWeb.ThermoLive do
use Phoenix.LiveView
alias ThermoWeb.ThermoView
def mount(_params, socket) do
{:ok, assign(socket, :temp, 32)}
end
def render(assigns) do
~L"""
Current temperature: <%= @temp %>
<button phx-click="set_temp">Set</button>
"""
end
def handle_event("set_temp", socket) do
{:noreply, assign(socket, :temp, 24)}
end
end






















