How to put dynamic elixir code in a heex template for alpinejs? For example -
x-data="{username: {@current_user.username}}"
The above is not getting interpreted correctly. In heex template what is the correct expression for this?
How to put dynamic elixir code in a heex template for alpinejs? For example -
x-data="{username: {@current_user.username}}"
The above is not getting interpreted correctly. In heex template what is the correct expression for this?
x-data={"username: '#{@current_user.username}'"}
i think it should be more like:
x-data={"{username: '#{@current_user.username}'}"}