I am trying to learn to build an app where an anonymous user gets a link thru SMS, with token to do a survey. My controller is not correct. Please help.
defmodule UndiOnlineWeb.SetterController do
use UndiOnlineWeb, :controller
def generate_survey_link(conn, _params) do
# Generate a token for the authenticated user
token = UndiOnlineWeb.Helper.generate_token()
conn = assign(conn, :token, token)
# Construct the survey URL with the token
survey_url = ~p"/survey?token=#{token}"
# Render a view that displays the survey URL
render(conn, :index, survey_url: survey_url)
end
end
In my template I am getting /survey?token… Should be http://localhost:4000/survey…