niccolox

niccolox

Live Render a single word with no wrapping div

I want to use a Phoenix LiveView to render a single word in HTML head in the root.html.heex.

LiveView looks like

  def render(assigns) do
    ~H"""
    <%= @website.theme %>
    """
  end

when I live_render

<html lang="en" data-theme={live_render(@conn, AppWeb.DataThemeLive)}>

I get

<div data-phx-session="SFMyNTY.g2gDaAJhBXQAAAAIZAACaWRtAAAAFHBoeC1GdTFmRXMyNFZWbkt1cGhGZAAMbGl2ZV9zZXNzaW9uaAJkAAdkZWZhdWx0bggAqWbAmQtf7RZkAApwYXJlbnRfcGlkZAADbmlsZAAIcm9vdF9waWRkAANuaWxkAAlyb290X3ZpZXdkACVFbGl4aXIuRm9sa2JvdFdlYi5UaGVtZXJEYXRhVGhlbWVMaXZlZAAGcm91dGVyZAADbmlsZAAHc2Vzc2lvbnQAAAAAZAAEdmlld2QAJUVsaXhpci5Gb2xrYm90V2ViLlRoZW1lckRhdGFUaGVtZUxpdmVuBgDIILangAFiAAFRgA.Q1XE8aDzcsIzYo8xqeCas-eeUWCrmt2lt6KCbVNczww" data-phx-static="SFMyNTY.g2gDaAJhBXQAAAADZAAKYXNzaWduX25ld2pkAAVmbGFzaHQAAAAAZAACaWRtAAAAFHBoeC1GdTFmRXMyNFZWbkt1cGhGbgYAyCC2p4ABYgABUYA.AdiJYO5X_LdaUNoE391eDDRRtpaFWgPySEKI4jJI-TI" id="phx-Fu1fEs24VVnKuphF">

synthwave</div>

Which is broken HTML.
Unsure what the best approach to resolve this is.

Marked As Solved

BartOtten

BartOtten

-skip-

Where Next?

Popular in Discussions Top

Rustixir
Hi everyone, im working on find best language/framework/system for high concurrency, high performance and stable performance after wor...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&amp;*())^% %%:&gt;" From this string, I want to only keep the integers, ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New

Other popular topics Top

chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement